jquery/jquery-mobile — Issue #3452: Consider adding cache-control headers to CDN'ed javascript/css
Author: mlibbey
Created: 2012-01-18 00:05:01+00:00
State: open

The CDN hosted JS and CSS currently (Jan 17 2012) do not have Cache-Control headers:
curl -I "http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: application/x-javascript; charset=utf-8
Date: Tue, 17 Jan 2012 22:51:11 GMT
ETag: "9e68fee-13fef-8d03d440"
Last-Modified: Sat, 19 Nov 2011 02:52:57 GMT
Server: ECS (sjc/4FB2)
X-Cache: HIT
Content-Length: 81903

If a header like
Cache-Control: max-age=31536000
is added, then browsers could cache the css/js for 1 year. Since the assets are versioned, this should be low risk, and would minimize CDN requests to protect the resource as well as allow some users to see fully functional pages when it is not reachable.