By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,916 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,916 IT Pros & Developers. It's quick & easy.

Globally turn page fragment caching off?

P: n/a
DC
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

Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <dc@upsize.de> wrote in message
news:11**********************@g14g2000cwa.googlegr 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

Nov 19 '05 #2

P: n/a
DC
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

Nov 19 '05 #3

P: n/a
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" <dc@upsize.de> wrote in message
news:11**********************@g14g2000cwa.googlegr 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


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.