Globally turn page fragment caching off?

Discussion in 'ASP .Net' started by DC, Oct 18, 2005.

  1. DC

    DC Guest

    Hi,

    (ASP.Net 1.1) is it possible to (programmatically and globally)
    deactivate page fragment caching? We have only two scenarios,
    development stage where we want caching off and testing where we want
    caching on. Is this doable? I think there is a config switch in 2.0,
    anything in 1.1?

    TIA for any hint,

    regards
    DC
    DC, Oct 18, 2005
    #1
    1. Advertising

  2. From http://aspnet.4guysfromrolla.com/articles/022802-1.aspx
    by Scott McFarland :

    <quote>
    Partial-Page Output Caching, or page fragment caching,
    allows specific regions of pages to be cached.

    ASP.NET provides a way to take advantage of this powerful technique,
    requiring that the part(s) of the page you wish to have cached appear
    in a User Control.

    One way to specify that the contents of a User Control should be cached
    is to supply an OutputCache directive at the top of the User Control.

    That's it!

    The content inside the User Control will now be cached for the specified period,
    while the ASP.NET Web page that contains the User Control will continue to
    serve dynamic content.

    (Note that for this you should not place an OutputCache directive in the
    ASP.NET Web page that contains the User Control - just inside of the User Control.)
    </quote>

    So, if you don't want page-fragment caching to occur,
    just don't place an OutputCache directive in your User Control's code.

    If the OutputCache directive is placed in the User Control,
    the control's content will be cached ( that's what page fragment caching is ).




    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "DC" <> wrote in message
    news:...
    > Hi,
    >
    > (ASP.Net 1.1) is it possible to (programmatically and globally)
    > deactivate page fragment caching? We have only two scenarios,
    > development stage where we want caching off and testing where we want
    > caching on. Is this doable? I think there is a config switch in 2.0,
    > anything in 1.1?
    >
    > TIA for any hint,
    >
    > regards
    > DC
    >
    Juan T. Llibre, Oct 18, 2005
    #2
    1. Advertising

  3. DC

    DC Guest

    Thanks Juan. Our requirement is to turn fragment caching off
    programmatically. Otherwise we need to remove all the output caching
    directives of all user- and webcontrols for testing and turn them back
    on for load testing. We want a simple switch in our .config file.

    Regards
    DC
    DC, Oct 18, 2005
    #3
  4. I don't think there's a flip switch you can just turn on and off.

    See
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenetchapt06.asp

    How many controls do you have ?
    How impractical is it to modify the OutputCache directive on them ?

    As a possible alternative, would setting the duration to "1" help ?
    ( For testing purposes that might help... )

    If you're using IIS 6, you can turn off the OutputCache completely in the
    processModel section, but that would require that your test environment
    be in a different box than the production environment, since it's a
    machine-wide setting.




    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "DC" <> wrote in message
    news:...
    > Thanks Juan. Our requirement is to turn fragment caching off
    > programmatically. Otherwise we need to remove all the output caching
    > directives of all user- and webcontrols for testing and turn them back
    > on for load testing. We want a simple switch in our .config file.
    >
    > Regards
    > DC
    >
    Juan T. Llibre, Oct 18, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. quique

    fragment page caching

    quique, Oct 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    quique
    Oct 30, 2003
  2. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    783
    Troy Simpson
    Jan 19, 2004
  3. Rohit

    Turn off caching

    Rohit, Nov 16, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    9,215
    Joerg Jooss
    Sep 1, 2005
  4. Robert Strickland

    Turn off Caching

    Robert Strickland, Feb 22, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    10,274
    Joerg Jooss
    Feb 24, 2005
  5. robert112
    Replies:
    1
    Views:
    437
    Juan T. Llibre
    Apr 26, 2007
Loading...

Share This Page