I’m currently playing around with a build / deployment script for minifying static resources. Following good practice I’d like to set an expire header far into the future for most of my javascript, stylesheet and images.
To my question, when one or more of the static files has changed clients should ask for the newest version of the file. Will adding something like /css/style.css ?1235 after the url be enough to trigger a new request? Or do I have to rename all my static files for each build (something like /css/style _12345.css)?
Update: Just to clarify, the reason that I’m asking is that I’ve noticed that a lot of other deployment scripts seems to take the “hard” path by renaming each file.
RFC 2616 3.2 Uniform Resource Identifiers says:
So,
http://foo/baris a different resource tohttp://foo/bar?baz.Some URIs are treated as equivalent, so
http://foo/bar?bazis the same resource ashttp://foo/bar?BAZ(see 3.2.3 URI Comparison).HTTP does contain some caching exceptions for handling the query part (see 13.9 Side Effects of GET and HEAD). I understand these to only apply to the exact same query.