Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Globally turn page fragment caching off?

Reply
Thread Tools

Globally turn page fragment caching off?

 
 
DC
Guest
Posts: n/a
 
      10-18-2005
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

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      10-18-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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
>



 
Reply With Quote
 
 
 
 
DC
Guest
Posts: n/a
 
      10-18-2005
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

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      10-18-2005
I don't think there's a flip switch you can just turn on and off.

See
http://msdn.microsoft.com/library/de...netchapt06.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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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
>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to cache part of a page without using fragment caching sam ASP .Net 1 03-07-2006 06:01 PM
Turn off Outlook 2003 archive settings globally? John Computer Support 0 07-20-2004 03:50 PM
globally prevent client browser caching gu4y ASP .Net 2 01-20-2004 06:44 AM
Fragment Caching inside page caching? Troy Simpson ASP .Net 0 01-19-2004 11:57 AM
fragment page caching quique ASP .Net 0 10-30-2003 11:17 AM



Advertisments