how to cache static content in asp.net mvc

L Paul
L Paul
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: 8138
Total Answered: 1
Total Marked As Answer: 0
Posted On: 07-Nov-2015 03:46

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
Moderator
1170 Points
210 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
banner

Blog

Active User (2)

 Log In to Chat