Ah, interesting argument. I've never personally been in a situation where
we've had to replace CSS referenced images enough times that manually
changing their URIs was a problem, even in environments where I was
deploying 5+ times a day. In practice, every time I've used CSS referenced
images, they've been because of backgrounds (rare changes), rounded corner
hacks or other browser hacks that don't change enough. I think you may have
sold me, and at the very least I shouldn't knock it until I try it. Anything
to kill those nasty cache issues that pop up.

Moral of the story: always use a cache buster.

On Mon, Jun 21, 2010 at 1:13 PM, TL <[email protected]> wrote:

> 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]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
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.

Reply via email to