May 21, 2012

forcing image reload

Its a well known feature, but I always manage to get a aha! everytime I talk about it.

Simply specifying a bogus query string at the end of a image url will force the browser to retrieve the file from the server, instead of the cache. Very useful when testing/developing graphics.

E.g.

Let’s say we have a NFS graph at this URL: http://yourname.blogsome.com/images/nfswrites.gif in your browser’s cache. In order to get the most recent version of the image from the server, simply specify a random query string at the end of the url

for e.g, all these URLS will load the image from the server on all occasions.. not from the cache.

http://yourname.blogsome.com/images/nfswrites.gif?A

http://yourname.blogsome.com/images/nfswrites.gif?b

http://yourname.blogsome.com/images/nfswrites.gif?c

http://yourname.blogsome.com/images/nfswrites.gif?d

Speak Your Mind

*