... | ... | @@ -74,17 +74,29 @@ Notes: |
|
|
|
|
|
gsutil setmeta -r -h "Content-Type:application/font-woff" -h "Cache-Control:public, max-age=3600" -h "Content-Disposition" gs://mathjax-cdn/mathjax/**.woff
|
|
|
|
|
|
|
|
|
### caching
|
|
|
|
|
|
This is a one time task. Proposed caching is 3 months for all but `MathJax.js` which gets 1 week.
|
|
|
|
|
|
$ gsutil -m setmeta -r -h "Cache-Control:public, max-age=7776000" gs://mathjax-cdn/mathjax/
|
|
|
$ gsutil -m setmeta -r -h "Cache-Control:public, max-age=3600" gs://mathjax-cdn/mathjax/**/MathJax.js
|
|
|
|
|
|
This is theoretically risky. Since caching can only be specified after making the file public, it could theoretically happen that MathJax.js is called and cached before the second command runs -- fixing it to a 3 month caching that cannot be undone.
|
|
|
|
|
|
Well, it didn't happen. So we're good.
|
|
|
|
|
|
### Logging
|
|
|
|
|
|
For logging, follow https://developers.google.com/storage/docs/gsutil/commands/logging
|
|
|
|
|
|
## TODO
|
|
|
|
|
|
* tests -- we don't actually have any tests that check the functionality of the CDN.
|
|
|
* CORS
|
|
|
* mimetype
|
|
|
* change caching time. Something like
|
|
|
* tests.
|
|
|
* CORS [vital]
|
|
|
* A simple test: switch mathjax.org over to the origin. user browsershots/browserstack etc to check rendering across IE, FF, Chrome, Safari.
|
|
|
* mimetype [non-vital]
|
|
|
* write script to `curl -I` all woff and otf files, compare header.
|
|
|
|
|
|
$ gsutil -m setmeta -r -h "Cache-Control:public, max-age=7776000" gs://mathjax-cdn/mathjax/
|
|
|
* swich over to new container `mathjax` (no idea why mathjax-cdn was chosen the first time around...)
|
|
|
|
|
|
but we don't want to apply this to MathJax.js. Not sure how to do this efficiently. |