How to specify Expires header for static resources in ASP.NET MVC?

Thanks to author of the post on He posted a link to the broadest description of the ways the header “Expires” can be specified for static resources. Here it is – clientCache.

Finally, I put the following setting in my web.config:

<!–Never Expires–>
<clientCache cacheControlMode=”UseExpires” httpExpires=”Sun, 07 Apr 2047 00:00:00 GMT” />

There is a point to notice. It seems virtual web-server which is ran under VS ignores such setting. I could found a reason why it’s so. If somebody point me out to the reason or solution I’ll be very appreciated.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Post

%d bloggers like this: