Last post Mar 31, 2010 07:48 AM by chintanpshah
Mar 31, 2010 04:26 AM|lloydz1|LINK
I've been trying to get image caching working for the last 8 hours and I keep the same problem time and time again, I'm trying to cache Images at the moment and then when thats succesful, apply this to cache my js and css files. I have at the moment Sql
Dependancy caching working on my dynamic pages but the page still takes to long due to images not caching.
What I have tried is going to IIS7 Management and adding HTTP Response Header for the images folder and setting various things for the cache control.
i dont care how long it caches it on the client or on the proxy servers i just would like it to check when the file was modified and compare it with the one in the client or proxy cache and if they are different then fetch the new image which has been ftp
up. i could solve this by changing the image name but the thing is the image name is generated when they are ftp'd to the site by an application and the name is a direct reference to the product so i cant change the name each time, as it would mean making
a lot of otherpages accross the board.
so What i would like, is to set and expiry date of lets say 32 days or more on the images and then check to see if they have changed by date modified or some other way of checking(Etags maybe) I'm not sure, if they have changed on the server then redownload
and recache them, I tried using post-check and pre-check together but that just permantly cached them, so when i change the image the only way it would display the new image is to just hit F5.
In Brief, how can i Cache images, on the client machine/ proxy cache and recache them when the modified date of the file has changed.
http response header
Mar 31, 2010 05:27 AM|lionadi|LINK
Have you tried output cache from the web application side? IIS should do all the required work for caching your pictures but this solution is probably better suited for dynamic content.
Try this link:
It guides you how to configure iis 7 for static content caching. Maybe that helps.
Mar 31, 2010 05:30 AM|chintanpshah|LINK
Consider configuring proper ETags.
Full List for better Performance:
Also, try to download YSlow add-in for firefox and test you site.
Mar 31, 2010 06:57 AM|lloydz1|LINK
Ok Maybe configuring Etags is the answer I'm not sure, But i dont know how. I check the links you gave me but they didn't really have a clear answer.
So my question is how do i program via IIS or in the code behind of my asp.net page, check for etag and if they are different redownload and re-cache the image. and every time an image gets ftp'd up will the etag change. It would be enough for me just to
check if the date modified has changed. I need it to do this across the board for all the images i have in the images folder (about 12000)
Mar 31, 2010 07:48 AM|chintanpshah|LINK