473,394 Members | 1,734 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,394 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 4858
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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
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...

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.