Fragment Caching (Partial Page Caching)

Although caching a whole web page is desirable sometimes, it is likely that you might only want to cache a specific portion of the web page. (For example, if you have a data-intensive or processing-intensive process used to generate a section of a page, which is dynamic in nature, but the rest of the page was not).

In this scenario, you want to cache only the resource-intensive sections of the page. This can be done by creating user controls for each area that needs to be cached.

After you create user controls for the cached fragments of the web page, you can set their @ OutputCache attributes as if they were a regular web page. This process is referred to as fragment or partial page caching. Fragment ...

Get Inside ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.