Thus wrote Visu,
I am currently working on my personl website a completely DB driven
web application. in that i ve updating the images thru my admin panel
.. but i am getting the old images not the update one when see the
pages in the front . when i explicitly right click and select
refresh button or hit F5 ,then my pages are loaded with new images..
why this kind of effect is happening. how to avoid the caching of
images in both the server side(page cache) and client side? can anyone
help me to solve this problem. i am accessing the admin module and the
pages in a same computer.
1) If you serve your images as static content through IIS:
Put all images in a common folder and set a HTTP Cache-Control header for
this folder in IIS manager, e.g.
Cache-Control: no-cache (-never use a cached copy without revalidation)
or
Cache-Control: max-age=43200 (-allow public caching for 12 hours [43200
seconds] at most)
2) If you serve your images as dynamic content through ASP.NET, e.g.
Response.Cache.SetCacheability(HttpCacheability.No Cache);
or
Response.Cache.SetMaxAge(TimeSpan.FromHours(12.0)) ;
Note that unless you're updating your images at an astounding pace, marking
them non-cacheable is hardly advisable ;-)
Cheers,
--
Joerg Jooss
ne********@joergjooss.de