473,405 Members | 2,310 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,405 software developers and data experts.

OutputCache directive vs Response.Cache.SetCacheability

Hi folks,
I have an infuriating problem. I have a number of pages that I want to cache
server-side only, using varybycustom. I have implemented a
GetVaryByCustomString in my global.asax. I am setting the caching behaviour
in the Page_Load as follows:

Response.Cache.SetCacheability(HttpCacheability.Se rverAndNoCache)
Response.Cache.SetValidUntilExpires(True)

Response.Cache.SetVaryByCustom("report.aspx")

Response.Cache.SetExpires(Info.PageCacheExpires)

(where Info.PageCacheExpires is a specific time for this instance of the
page).

My problem is that this works most of the time, but occasionally it just
stops working - the page is rendered on every request (and the
Global.GetVaryByCustomString stops getting called). The only way to fix this
is to add an OutputCache directive to the page, at which point the caching
works reliably. The problem here though is that the Duration attribute
(which is required) of the directive overrides the value I'm setting in
Response.Cache.SetExpires.

Any thoughts?

(this is asp.net 1.1)

Pete Griffiths

Feb 21 '06 #1
0 2073

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache...
1
by: Edward Wilde | last post by:
Hi, Does anyone know how to examine items in the ASP.NET cache that are added using the OutputCache directive in framework 1.1 i.e. <%@ OutputCache Duration="300" VaryByParam="None"...
2
by: alex | last post by:
according to docs these two caching methods are equal: 1) <%@ OutputCache Duration="10" VaryByParam="id" %> 2) Response.Cache.SetExpires(DateTime.Now.AddSeconds(10));...
2
by: YeeCN | last post by:
Hi, I have a page which contain a image control for displaying a .gif file. The application allows the user to upload a different image to replace the existing one - but when I do...
5
by: Tim_Mac | last post by:
hi, i read that by adding the following code to by aspx pages, it would not store temporary internet files: Response.Cache.SetCacheability(HttpCacheability.NoCache); it didn't actually work...
5
by: Arpan | last post by:
I am using the following code to cache the page output for 60 seconds: <%@ OutputCache Duration="60" VaryByParam="*" %> <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As...
3
by: =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post by:
Hi, I have an ASP.NET 2.0 application that allows content search. Search is included in all pages and a cross postback to the search results page is performed with the text inserted by the user....
1
by: David Lozzi | last post by:
Howdy, How do I forcibly clear out the cache for entire web application? I want to give my customer the option to clear the cache after any major data updates they may do. Thanks! David...
0
by: ELMICHA | last post by:
Helo, I have include @OutputCache on my ASPX with location="Any" ¿Can I ser different cache time from client than from server? I would like to cache the home page of my site 3 minutes on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.