how to cache static content in asp.net mvc

L Paul
L Paul
Member
8 Points
4 Posts

Hi,

I am working on website optimization in .NET MVC application. I do output caching for dynamic image and page. But is there any cache method for static content images etc.?

 

Views: 9837
Total Answered: 1
Total Marked As Answer: 0
Posted On: 07-Nov-2015 03:46

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
Teacher
4822 Points
23 Posts
         

Hi L Paul,

Use following for Client Caching static content:

Add following in <system.webserver>...</system.webserver> section of Web.config:

<staticContent>
<clientCache cacheControlMode="UseMaxAgecacheControlMaxAge="365.00:00:00" />
</staticContent>

 

Posted On: 07-Nov-2015 04:13
 Log In to Chat