To publish a new release, project maintainers should commit new assets to the cdn/ directory and push to the main branch. The jQuery CDN (code.jquery.com) and releases site (releases.jquery.com) will both automatically rebuild.
jQuery CDN
The jQuery CDN assets are served from a static file server (Nginx), provisioned through Docker.
Run it with a shell entrypoint and set interactive/tty mode by adding the parameters -i -t --entrypoint /bin/sh.
Note that when inspecting the container, nginx will not be started.
Simple requests for static files redirect to code.jquery.com/*, e.g. curl -i 'http://localhost/jquery-3.0.0.js'.
Requests with the access key will respond by serving the file: curl -i -H "x-cdn-access: $CDN_ACCESS_KEY" 'http://localhost/jquery-3.0.0.js'
Requests with an invalid key will redirect the same as without: curl -i -H "x-cdn-access: wrong" 'http://localhost/jquery-3.0.0.js'
Production deployment
First, generate a CDN access key: openssl rand -hex 32.
At a hosting platform of your choosing, build or pull the container, and pass the CDN access key as run environment variable.
Finally, configure the CDN to use the container address as its origin, with special handling to augment origin pulls with a Host: code.jquery.com header, and a x-cdn-access header with the access key.
In case of emergency
If you need to deploy a standalone codeorigin site immediately, or if there are origin pull failures and you're not sure why, then deploy the container without any CDN_ACCESS_KEY environment variable. The codeorigin container then default to its unrestricted mode (no offload redirects).
WordPress build
This repository is also used to update the asset catalog at https://releases.jquery.com/, which is an auto-generated WordPress site.
请发表评论