473,416 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 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 2456
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 x, to make t possible i put the next directive in...
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. Is it possible to cache parts of a page on the...
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 other things, which causes the page to take a little...
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: Response.Cache.SetCacheability(HttpCacheability.NoCache); in every page's...
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: Response.Cache.SetCacheability(HttpCacheability.NoCache) Still, sometimes the page is retreived...
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 HTTP-EQUIV="Expires" CONTENT="-1"> <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 elaborate more by telling you what I am doing. I am...
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 can I cache just a part of my page (two...
15
by: demiourgos | last post by:
Is there a way to embed html page from different server into another html page without using javascript ?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.