473,805 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP header immediate expiration and Page_Load in asp.net

I've set my aspx page to expire immediately using the management console,
HTTP headers tab. Considering this scenario:
a user visits the aspx page in question, then moves to another page, then
hits the Back button to return to the page in question. At that point,
shouldn't the Page_Load event fire for the page since it was set to expire
immediately?
Thanks
Timo

Nov 19 '05 #1
2 2010
Timo wrote:
I've set my aspx page to expire immediately using the management
console, HTTP headers tab. Considering this scenario:
a user visits the aspx page in question, then moves to another page,
then hits the Back button to return to the page in question. At that
point, shouldn't the Page_Load event fire for the page since it was
set to expire immediately?


No. Back button behaviour is unfortunately browser-specific. Many
browsers even adopt their behaviour depending on what Cache-Control
header they receive, or whether the underlying connection is secure or
not.

In addition to Expires (which isn't really that useful anyway), try
Cache-Control: no-cache or Cache-Control: max-age=0.

Cheers,
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Nov 19 '05 #2
Thanks, Joerg. Setting No-cache in code-behind has the desired effect, as
you suggested.
Timo
"Joerg Jooss" <ne********@joe rgjooss.de> wrote in message
news:xn******** *******@msnews. microsoft.com.. .
Back button behaviour is unfortunately browser-specific. Many
browsers even adopt their behaviour depending on what Cache-Control
header they receive, or whether the underlying connection is secure or
not.

In addition to Expires (which isn't really that useful anyway), try
Cache-Control: no-cache or Cache-Control: max-age=0.

Nov 19 '05 #3

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

Similar topics

2
374
by: Rob Douglass | last post by:
Hi all, I have a site that is compeletely restricted by form authentication. In the case where a user's cookie expires and then they click on the logout button on the site, the authetication process is forcing them to login again so that they can log out. I've been trying to use "HttpContext.Current.User.Identity.IsAuthenticated" as the first piece of code in the "Page_Load" routine, but the server is redirecting the
1
3585
by: Mario Hébert | last post by:
I have a simple C# object(class) that I reference in a <OBJECT classid="mydll.dll#nmsp.Ctrl"> tag of an HTML page generated by ASP.net. In a case where the Enable content expiration isn't checked for my website, i can call a public method of the object via javascript and it's working. When the Enable content expiration(immediately) is effective for my website, i always have a javascript error telling me that the object or the method...
0
1695
by: TR | last post by:
If mypage.aspx is set to expire immediately using the management console page properties dialog, HttpHeaders tab, -- does the expiration setting take effect as soon as the dialog changes are applied? Assuming mypage.aspx is the first in a sequence of pages, and mysecondpage.aspx comes after it, if the immediate expiration setting is in effect, should clicking on the Back button on mysecondpage.aspx, to return to mypage.aspx, cause...
6
3449
by: ragunath.cr | last post by:
Is it possible to read & modify TCP header using C. Also I want a sample C code for this. Please reply immediately.
0
1437
by: mohdowais | last post by:
I have just stumbled upon an what seems to be a very under-rated feature in IIS - the "Enable Content Expiration" option under a website's properties. I have an ASP.NET web application that has a lot of subdirectories and each one has its own set of images (I know its not best design practice, but there is a business reason behind it). Many pages on the site have quite a few images and there is a noticeable time lag each time the user...
0
902
by: ibiza | last post by:
Hi, I am trying to use ASP.NET caching like that : Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not (Cache("test") Is Nothing) Then Response.Write(Cache("test")) Else Cache.Insert("test", "woot woot", Nothing, Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5)) Response.Write("Cache initialized")
2
3262
by: sck10 | last post by:
Hello, Can someone provide a simple example of how to use the immediate window with ASP.NET? No matter what I type, I get the following statement: The expression cannot be evaluated while in design mode. Thanks, sck10
4
2489
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code m_Token = null in order to destroy the session token when the user logs out. However, I'm finding that setting class instance to null results in no header being sent back to the client, with the result that the client actually remains with an...
2
2546
by: helveticus | last post by:
I'm having difficulties setting the expires header for images and css files in my compression HttpModule. Compression is carried out by context_BeginRequest and works fine (code not shown). However, I can't set the expiration header for selected file extensions (ie. gif and css). Firebug' s YSL reports that these components do not have a far future Expires header. Question: How should I modify the code to set the expires header? TIA...
0
9718
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10369
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.