Search code examples
c#asp.net-mvccachingdynamicdynamic-data

How to efficiently cache dynamic content in asp.net mvc?


"Blogging on App Engine, part 1: Static serving" describes how to properly handle dynamic content caching when using python with GAE. It covers DownStream caching, conditional GETs, 404 responses, Etags... I haven't found anything as comprehensive related to a targeted asp.net mvc implementation.

What would be the most elegant/readable/maintainable way to implement this when targeting asp.net mvc platform ?

EDIT: "Enabling Client-Side Caching of Generated Content in ASP.NET" provides one with some interesting insight about the subject.


Solution

  • Combining the OutputCache attribute (which Yannis suggests) and modifying the HttpContext should work.

    There's some information about conditional GETs and Etags: Conditional GETs and Etags

    If someone knows a better way to solve this problem: I'm interested :-)