What's the best way to version CSS and JS URLs?

Posted by David Eyk on Pro Webmasters See other posts from Pro Webmasters or by David Eyk
Published on 2010-11-05T13:31:51Z Indexed on 2012/11/03 5:27 UTC
Read the original article Hit count: 286

As per Yahoo's much-ballyhooed Best Practices for Speeding Up Your Site, we serve up static content from a CDN using far-future cache expiration headers. Of course, we need to occasionally update these "static" files, so we currently add an infix version as part of the filename (based on the SHA1 sum of the file contents). Thus:

styles.min.css

Becomes:

styles.min.abcd1234.css

However, managing the versioned files can become tedious, and I was wondering if a GET argument notation might be cleaner and better:

styles.min.css?v=abcd1234

Which do you use, and why? Are there browser- or proxy/cache-related considerations that I should consider?

© Pro Webmasters or respective owner

Related posts about static-content

Related posts about cache-control