472,352 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

Globally turn page fragment caching off?

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
3 2389
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: quique | last post by:
Hi I,m gonna explain my scenario problem: I've got an user control that i want to cache in diferent pages attending to the value of a parameter...
4
by: Captain Chaos | last post by:
Is it Possible to Cache Pictures JPG/BMP on the Client Browser ? The other Elements of the Page should not being cached because they change. ...
0
by: Troy Simpson | last post by:
Hi, I have a website which is made up of dynamic pages. Each page that's loaded has some code which looks at which template to load amongst...
2
by: gu4y | last post by:
Hello All, Is there anyway to globally prevent client browser caching in ASP.NET? Otherwise, I will have to put:...
13
by: Rohit | last post by:
I need to turn off caching in my ASP.NET page. I have set the following code in Page Load event: ...
4
by: Robert Strickland | last post by:
I wish to turn off browser caching through some meta tags. Note the following: <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META...
0
by: syedsheeraz | last post by:
Hi all. Does anyone know if there is a way to gain programmatic access to the user control inside of a page after it has been cached? Let me...
1
by: sam | last post by:
Hi, I know fragment caching where you can use a cached user control in a non-cached page (or the opposite) But without using a user control, how...
15
by: demiourgos | last post by:
Is there a way to embed html page from different server into another html page without using javascript ?
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.