Preventing Image Caching

Caching is a great way to improve performance on the Web;
however, sometimes you might want to force images to be
downloaded on each and every visit to a Web page. An example
of this might be a page that generates images dynamically
(for example, bar charts) but where the page uses the same
filenames over and over. Obviously, in this case, you must
require that the image be downloaded every time. So, to
prevent images in a directory from being cached, launch the
Internet Services Manager, navigate to the images directory in
question, then right-click the folder, and choose Properties.
In the Properties dialog box, select HTTP Headers, and then
click Add. Enter the following three headers:

cache-control:no-cache
pragma:no-cache
expires:0

This will prevent any images in the folder from being cached
on the client, so that you can modify them as often as you
like without fear of users seeing out-of-date versions.

You might also like...

Comments

ElementK Journals

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone” - Bjarne Stroustrup