Here is another problem with query parameters:
You have a CSS file with background URL
background:url("group/google-appengine/icon?hl=en");
You call the CSS file with cache buster parameter:
http://example.com/static/base.css?timestamp=12345678
The CSS file will call the image /group/google-appengine/icon?hl=en
without the cache buster. Unless you want to change your CSS files
manually every time you replace an image or do it in a build using
some script, you cannot version an image that you use from CSS.
On the other hand, if you name the CSS file:
http://example.com/static/123456/css/base.css
and make the URLs relative in CSS:
background:url("../group/google-appengine/icon?hl=en");
Then the browser will call the URL:
http://example.com/static/123456/ group/google-appengine/icon?hl=en
Every time you change a version number, it affects ALL your static
files in one shot, with zero work for you. Including images from CSS,
and many other things that can be done relative.
I agree that caching is not something that works accurately and
predictably, but you can still make it more effective by avoiding
known problems.
If you are into rapid development, where you release almost every day,
then the advantage of zero work system for versioning static files is
invaluable. You never have to mess with it, just increase the version
number and all static files get upgraded in one shot.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.