Enable Page Output Caching code. - Caching pages and data

Q.  You want to enable Page Output Caching in ASP.NET. What code you will write in ASPX page.

- Published on 27 Jul 15

a. <%@ OutputCache Duration="30" VaryByParam="none" %>
b. <%@ OutputCache VaryByParam="none" %>
c. <%@ OutputCache Duration="30" %>
d. None of the above.

ANSWER: <%@ OutputCache Duration="30" VaryByParam="none" %>
 

    Discussion

  • ramesh   -Posted on 24 Sep 15
    You enable Page Output Caching by adding
    <%@ OutputCache Duration="30" VaryByParam="none" %> code in aspx file
    This page will be cached 30 second.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)