Tuesday, December 30, 2014

Re: how not to cache background image?

A simple solution is to add a parameter to the URL (ex. ?v=1 or ?<random_number>), and change the parameter value to force image reload. The parameter can be ignored by the server side, just used to force the image reload in the client side.

See http://stackoverflow.com/questions/1431512/is-there-a-way-to-force-browsers-to-refresh-download-images

On Tuesday, December 30, 2014 5:55:10 AM UTC+1, Magnus wrote:
Hello,

I set the background image of a web app in the root panel like this:

getElement().getStyle.setBackgroundImage(url);

When I change the background image, I only change a symbolic link on the server, so the url remains the same.

However, when I change it, the users still see the old image.

What can I do, so that the change will be visible immediately?

Thanks
Magnus

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment