Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP wont expire

Status
Not open for further replies.

incron

Technical User
Mar 16, 2002
60
US
Hello everyone

I have a challenge with my ASP page I cannot get it to expire. I have tried and added several lines of code including pragma statements and Expire.Absolute as well as setting the expire setting to -2000 - no change. I have waited for quite some time and still no expire. Currently it look like this

option explicit
Response.Expires = -2000
Response.cacheControl="no cache"
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"



Server.ScriptTimeout = 600
' All communication must be in UTF-8, including the response back from the request
Session.CodePage = 65001
 
response.expires has to be a POSITIVE value in minutes.

Negative values means NO cache expiry is set. meaning never expire.

Expire.Absolute? there is no such object OR property.

Response.ExpiresAbsolute which takes a date and time as the value does.



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Chris - thanks I will try it - and FYI this is taken directly for MSDN


you can use a negative number for the Expires property to expire the response immediately, as shown in the following code:
<%Response.Expires = -1 %>
 
Chris I set the HTTP Headers to expire in 1 minute and matched that to the setting on the asp page as follows:

<% Response.ExpiresAbsolute = #May 31,2010 13:30:15# %>

I then restarted the dedicated server

No change

I also tried <% Response.ExpiresAbsolute = Now() %>
No change


Incidentally running 2003 svr with IIS 6.0
 
Update

Ok guys


I have tried everything I have even set the asp page to session.abandon at the very top. I have set the expire setting in IIS to expire immediately. I have reset the website and stopped cleared and restarted firefox and it still wont expire the page.

I have also restarted the entire dedicated svr – no change. Any ideas…

 

Are you sure Firefox doesn't have a Session Manager add-on installed which restores sessions?


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Mark

If that's true is there anyway to pragmatically bypass this from the ASP perspective?
 


Here's a link that has some information on the subject. There is a tidbit about enabling cache expiration in IIS itself:

To specify headers for an area of a site, select it in the Administration Tools interface, and bring up its properties. After selecting the HTTP Headers tab, you should see two interesting areas; Enable Content Expiration and Custom HTTP headers. The first should be self-explanatory, and the second can be used to apply Cache-Control headers.


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Thanks Mark

I tried several adjustments on the Headers In IIS earlier to no avail. I wonder if it has something to do with flash being embedded in the asp file...??
 

I don't work with Flash, so I couldn't tell you. Without knowing the circumstances and issue you are trying to solve, it's hard to suggest a work around as well.


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top