Wednesday, 29 January 2014

Fragment Caching

Fragment Caching
Caching parts of webform is called as Partial caching or Fragment caching. In a web application development, there might be scenarios where most parts of the web page changes, but only a specific section of the page is static. Let's say that specific section also takes a long time to load. This is an ideal scenario, where fragment caching can be used.

Steps to fragment cache a webform
1. Encapsulate that sepcific sections of the page that does not constantly change into a user control.
2. Use the OutputCache directive on the user control to specify the cache settings.
3. Drag and drop the user control on the webform.

<%@ OutputCache Duration="60" VaryByParam="None" Shared="true" %>

No comments:

Post a Comment