31 points · by oppilman · 16y ago · 6 comments
but with no attrition.
Why post a file called "foo-12930.css" and show it to browsers at "foo.css"? The opposite is better - keep updating foo.css (and use version control), but show it to users as "foo.css?some-timestamp". This is what Rails does. If your server is configured to tell browsers to cache CSS files for a year, they will request the file once, then continue to use the cached version until you update the file. Then they'll see that it has a new timestamp and get the new version.
This post (and the previous one) show how to do this in PHP: http://sleeplessgeek.blogspot.com/2010/03/cache-busting-in-p...
# non-www -> www"
RewriteCond %{HTTP_HOST} !^www\."
RewriteRule . http://www.%{SERVER_NAME}%{REQUEST_URI} [R,L]"