3 ms·
The problem with script.js?v={timestamp} is that it's ignored by some browsers while script_{timestamp}.js isn't. And with script.js?v={timestamp} you can't set
by amix 18y ago
The problem with script.js?v={timestamp} is that it's ignored by some browsers while script_{timestamp}.js isn't. And with script.js?v={timestamp} you can't set good cache headers.
Also, if you ever move to a CDN, then you are forced to use real versioning (at least with Amazon Cloudfront).
The versioning scheme we use is `md5 hash of name + file contents + file extension` (and not timestamp).
- delano 18y agoI'm not aware of a browser that ignores URI parameters. Moving to a CDN does not force you to put versioning in the path or filename. The URI parameter merely tricks the browser into thinking there is a new file. The parameter itself is otherwise ignored.
- amix 18y agoAmazon Cloudfront forces you to put versioning if you want to expire objects manually, check out this page: http://docs.amazonwebservices.com/AmazonCloudFront/2008-06-30/GettingStartedGuide/index.html?NextSteps.html#Expiration http://docs.amazonwebservices.com/AmazonCloudFront/2008-06-3... (under `Object expiration`). Unless you specify "Cache-control: no-cache" header you aren't really sure how the browser caches your static files (especially if the user is behind a proxy - and even "Cache-control: no-cache" can easily be ignored).