| 1. |
What is Page Caching? |
|
Answer» For page caching, we need to specify @OutputCache directive at the top of the page as per the following syntax: <%@ OutputCache Duration=5 VaryByParam="None" %>As should be obvious, there are two ATTRIBUTES to this. They are:
In the above piece, we have indicated the VaryByParam value as None which means the page content to be served is the equivalent paying little mind to the parameters went through the querystring. On the off chance that there are two REQUESTS to a similar page with fluctuating querystring parameters, e.g.: .../PageCachingByParam.aspx?id=10 and .../PageCachingByParam.aspx?id=11]A separate page content is produced for every ONE of them, the mandate ought to be: <%@ OutputCache Duration=5 VaryByParam="id" %>The page content for the two requests will each be stored for the time indicated by the Duration characteristic To determine numerous parameters, use a semicolon to isolate the PARAMETER names. On the off chance that we indicate the VaryByParam property as *, the reserved substance is shifted for all parameters went through the querystring. A few pages create distinctive substances for various programs. In such cases, there is an arrangement to shift the reserved yield for various programs. The @OutputCache order must be changed to: <%@ OutputCache Duration=5 VaryByParam="id" VaryByCustom="browser" %>This will change the stored yield for the browser as well as its versions. I.e., IE5, IE 6, Netscape 4, Netscape 6 will all get distinctive cached versions of the output. |
|