Configure OutputCache for ASCX from web.config's cache profiles

Posted by zar on Stack Overflow See other posts from Stack Overflow or by zar
Published on 2010-04-15T15:45:09Z Indexed on 2010/04/15 15:53 UTC
Read the original article Hit count: 469

Filed under:
|
|
|

Hello, To configure aspx pages' OutputCache from one place, there is a great tool which is the CacheProfile attribute in <%@ OutputCache %> associated with a custom cache profile defined in the web.config :

<caching>
      <outputCacheSettings>
        <outputCacheProfiles>
          <add name="myProfile" duration="300"  />
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>

And the line :

<%@ OutputCache CacheProfile="myProfile" VaryByParam="None" %>

does the job. But how to do the same thing for ascx user controls ? CacheProfile isn't in <%@ OutputCache %> :S Is there a workaround ? Thanks.

© Stack Overflow or respective owner

Related posts about cache

Related posts about ascx