472,798 Members | 1,235 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

page outputcache.... varyByCustom = "Browser"

I had .....
<%@ OutputCache Duration="5000" Location="Server" VaryByParam="none" %>

Then I added "browser"
<%@ OutputCache Duration="5000" Location="Server" VaryByParam="none"
VaryByCustom="browser" %>

After I added browser... it stopped caching pages....
is there an explanation or... did I observe the problem wrong?

Hosting company probbably have many more on the same machine.. is there a
chance that cacching will not work, if there are memory constraints.

Thanks
Nalaka
Oct 13 '06 #1
1 4815
Hello Nalaka,

As for the OutputCache of ASP.NET page, when you specify the
"VaryByCustom=browser", that means the page's output content will be cached
based on the client-side web request's browser header information(this is
usually stored in useragent http header).

And for your scenario, if you have the following cache setting in page:

<%@ OutputCache Location="server" Duration="300" VaryByParam="none"
VaryByCustom="browser" %>

the page will be cached according to the two flag:

** duration="300"

** VaryByCustom="browser"

So when you use IE to visit the page(no local or remote machine), the
output result will be cached and only after 300 seconds will the cache be
invalid. And if you use another browser(e.g firefox) to visit the page,
the server-side will generate another cache versino of this page, and all
seqential requests from other machine using firefox(same version) will will
get the same cached output (until it expires after 300 seconds).

I've tested this through the following test page:

================
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="OutputCachePage.aspx.cs" Inherits="Cache_OutputCachePage"
%>
<%@ OutputCache Location="server" Duration="300" VaryByParam="none"
VaryByCustom="browser" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>
===============

=========code behind=========
public partial class Cache_OutputCachePage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<br/>Datetime: " + DateTime.UtcNow.ToString());

}
}
================

As for the "it stopped caching pages", what's the detailed behavior? Do you
mean no matter you use different browser not not, it will always output new
updated content each time you send reqeust to the page(refresh the browser)?

Please feel free to let me know if you have anything unclear.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.






Oct 16 '06 #2

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

Similar topics

3
by: Ray Torres | last post by:
I would appreciate any help with the following problem. I have several different htm pages with (simalar) forms that are processed by the same PHP script. If there is data missing on the form,...
3
by: Simon Wigzell | last post by:
I'm using : window.location.href = to redirect to a web page. From the new webpage, when you click the browser "Back" button you of course end up on the same old page and get redirected...
2
by: Eddy Stone | last post by:
Apologies in advance... I am sure this question will have been asked before in some form or another - please don't flame me ! I am new to creating webpages - is there a website where I can "view"...
7
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm"...
2
by: | last post by:
I like the "view in browser" feature of vs.net: right click from an aspx page, and preview a working version of the page. I don't like how this can't be launched from the pages' codebehind. The...
5
by: jfinnell | last post by:
Hi I'm working with the beta version of this product. I place the web in my master page, then link to my other pages. Set them up. When I select view in browser to check what I have done...
0
by: Amil Hanish | last post by:
Earlier I had inquired as to why a normal <a hreftag didn't work when using the VS hosted site using a random local port. The more I think about it, this seems very wrong. Using the random port...
3
by: Jukka K. Korpela | last post by:
Some time ago in this group, someone suggested that we should develop a "different" user style sheet to demonstrate what a user style sheet or a browser style sheet _could_ do. I guess the idea was...
3
by: Willy | last post by:
I have a website that uses querystrings on a certain page to show multiple contents. I have created mapped pages to hide the gory details of these querystrings. So instead of...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.