Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi folks,


I have been trying to cache image resources of my application in client browser.I googled I found different solutions.some at IIS level.some suggested to create custom handlers.but still i have confusion to proceed.

As i don't have access to IIS. Is there any best way we can cache images on client.please suggest your thoughts.



Thanks,
Syed
Posted

You can not cache ONLY images without custom handlers...You can control client side caching using web.config settings...It will affect all content of course...
http://www.iis.net/configreference/system.webserver/staticcontent/clientcache[^]
 
Share this answer
 
Comments
[no name] 21-Dec-14 10:13am    
hi kornfeld,
thanks for your response,but what do you mean by it will affect all content.if i am right i will it will cache all resources including css/js files..
[no name] 21-Dec-14 10:21am    
in some examples i found these lines in header.

as i am new to this caching.could u please help me to understand.

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
[no name] 21-Dec-14 11:08am    
i have added below lines in web.config
<clientcache cachecontrolcustom="Public" cachecontrolmode="UseMaxAge" cachecontrolmaxage="30.00:00:00">

i still dont see any change in loading.
Nice article - Caching Images in ASP.NET[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900