Enable output caching for all GET requests

  • Thread starter Joern Schou-Rode
  • Start date
J

Joern Schou-Rode

I would like to enable output caching for every GET request in my ASP.NET
MVC application. From searching the net, I am not able to find any central
way to enable such caching. All articles seems to be focusing on how to
enable caching for specific URL's, possible varying by HTTP headers og
query string parameters.

I do not need any varying, except from the URL, and I want caching to be
used for any GET request. IMHO such setup should only concern the IIS, but
the articles I find all seem to be specific to ASP.NET apps.

Am I missing something really simple?

Thanks in advance.
 
D

David Wang

IIS does not cache responses of dynamic applications like ASP.Net
since by-definition, their output can be "dynamic" and hence not worth
caching. IIS is never told by dynamic applications the necessary
details to cache properly -- hence the safest, most correct action is
to not cache. On its own, IIS only caches static pages since by
definition, they are relatively "static" over time and hence worth
caching.

However, ASP.Net has specialized knowledge, provided by the
programmer, on what bits of its dynamic pages are "relatively static"
and thus worth directing IIS to cache. Therefore, in an ASP.Net
application, you need to concentrate on ASP.Net for caching support.

Now, it is always possible that your application relies on a caching
semantic which is not expected by ASP.Net and thus not cooperate with
ASP.Net's generic caching support. In those cases, you will either
have to forego caching, or figure out a design for your ASP.Net
application that is compliant with how it works. Or write your own
proprietary software/cache that works the way you want.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top