Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M MathJax
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 304
    • Issues 304
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MathJax
  • MathJax
  • Wiki
  • CDN Hosting at Google Cloud Storage

CDN Hosting at Google Cloud Storage · Changes

Page history
clean up authored Feb 21, 2014 by Peter Krautzberger's avatar Peter Krautzberger
Hide whitespace changes
Inline Side-by-side
CDN-Hosting-at-Google-Cloud-Storage.md
View page @ 7d76af2c
*Note: these are preliminary notes about using Google Cloud Storage as a CDN service*
## Preliminaries
### Preliminaries
* The documentation home is https://developers.google.com/storage/index.
* The main tool is `gsutil`.
......@@ -8,23 +8,30 @@
### Copying
Notes: recursively (-R), compressed (-z), verbose (-v) https://developers.google.com/storage/docs/gsutil/commands/cp
Notes:
gsutil cp -Rzv mathjax gs://mathjax-cdn/
* gsutil option: -m multithreaded (higher load+cost, faster)
* cp options: recursively (-R), compressed (-z), verbose (-v) https://developers.google.com/storage/docs/gsutil/commands/cp
This also works within google storage (which is faster as it does not go through the local machine).
gsutil -m cp -Rzv mathjax gs://mathjax-cdn/
Also of note: `gsutil -m cp -Rzv xyz xyz" -- the `-m` option is for multithreaded/parallel action. This increases costs and decreases performance, but very useful for PNGs...
This also works within google storage, i.e., `gsutil cp gs://bucket1/file1 gs://bucket2/`
### make bucket public
Notes: https://developers.google.com/storage/docs/gsutil/commands/acl#set
Notes:
* should only be needed once
* https://developers.google.com/storage/docs/gsutil/commands/acl#set
gsutil -m setacl -R -a public-read gs://mathjax-cdn
### set CORS
Notes: should only be needed once, https://developers.google.com/storage/docs/cross-origin
Notes:
* should only be needed once
* https://developers.google.com/storage/docs/cross-origin
create XML file with
......@@ -53,17 +60,16 @@ Save as `cors.xml` and run
### set headers
Notes: https://developers.google.com/storage/docs/gsutil/commands/setmeta
gsutil setmeta -r -h "Content-Type:font/opentype" -h "Cache-Control:public, max-age=3600" -h "Content-Disposition" gs://mathjax-cdn/mathjax/2.3-latest/fonts/HTML-CSS/TeX/otf/*.otf
EOT and SVG are detected correctly during upload. WOFF is set to the old `x-font/woff`, so needs changing (and a bug report at Google).
Notes:
Note: unfortunately we can't just use something like gs//mathjax-cdn/*.otf
* https://developers.google.com/storage/docs/gsutil/commands/setmeta
* keep the `**` to match files in subdirectories https://developers.google.com/storage/docs/gsutil/addlhelp/WildcardNames
* EOT and SVG `content-type` headers are detected correctly during upload.
* WOFF is set to the old mime type `x-font/woff`; that works but we decided to go with the future-proof
* bug report at Google?
or can we? https://developers.google.com/storage/docs/gsutil/addlhelp/WildcardNames)
gsutil setmeta -r -h "Content-Type:font/opentype" -h "Cache-Control:public, max-age=3600" -h "Content-Disposition" gs://mathjax-cdn/mathjax/2.3-latest/fonts/HTML-CSS/**.otf
Yes. E.g. ``gsutil ls gs://mathjax-cdn/mathjax/2.3-latest/fonts/HTML-CSS/**.woff`` will list all woff files in subfolders.
## TODO
......
Clone repository

MathJax Wiki

  • Contributing
    • Contributor License Agreement etc
    • Quick guide to translating mathjax
  • Development
    • Development Process
      • Release Process Checklist
      • Documentation Update Process
      • Source Control Policies
    • Design Documents
      • MathJax Roadmap
      • CDN Hosting
        • Managing Rackspace Cloud Files & CDN
        • Directory Structure
        • .htaccess settings
        • CDN requirements
        • CDN Hosting at Google Cloud Storage
      • Performance Discussion
      • Profiling and Diagnostics Tools
      • Configuration Options
      • Documentation generation guide
      • Testing
        • Platforms supported
        • Test Machines
  • MathJax web presence
  • Drafts