Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2003, 10:54 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pages not expiring

Hi folks

   below is the code that issue on each of my pages prior to the <HTML> My pages should expire, but they don't.
Can anyone tell me why they aren't expiring??
Sure would appreciate it :-)

<%@ Language=VBScript %>
<%Response.Buffer = true%>
<%Response.Expires = 0%>
<%Response.CacheControl = "no-cache"%>

 
Old October 31st, 2003, 03:00 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to try this:
Code:
<%
  Response.ExpiresAbsolute = #1/1/1980#
  Response.AddHeader "cache-control", "private"
  Response.AddHeader "pragma", "no-cache"
%>
This will prevent the page from being cached.

Regards,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 31st, 2003, 07:19 AM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

tried it and they still don't expire.
this is crazy.:(

 
Old October 31st, 2003, 07:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Did you empty your cache prior to testing it?

Anyway, I'm using the following:
Code:
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
 
Old November 2nd, 2003, 12:03 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what does the "Pragma" mean ??

 
Old November 2nd, 2003, 12:23 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am another question about pages expiring.
Do I understand the page will expire afer the user has been redirected to another page?
Just when does a page expire?
Thanks so much, I do appreciate it:D

 
Old November 2nd, 2003, 01:31 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The pragma instruction is used to prevent any servers between you and the remote server (like proxies and caching servers) from caching the page.

http://www.semi-retired.com/kevin_al...tocolAdds.html

A page will expire when its expire date has passed. With the code below, a page will expire immediately. This means that when you navigate to another page and then press the Back button of your browser, you should get a new page.

HtH,


Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 2nd, 2003, 05:08 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you. Some pages are expiring and some are not.
I have no clue why some do and some don't.
I have looked at the coding and see no real reason for it.
Would anything have to do with Internet Explorer settings??
I am working in localhost mode.
And on the web server, some do expire and some don't.
It's really driving me nuts!


 
Old November 2nd, 2003, 06:56 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I can imagine it's driving you nuts. How did you configure Internet Explorer? (Not that it should matter, I think.). I think the following code is the definite way to prevent caching (note the change in the cache-control).
Code:
Response.ExpiresAbsolute = #1/1/1980#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, must-revalidate"
If this doesn't help, check your browser. Did you clear the entire cache (with the browser closed) before you requested your pages?

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 3rd, 2003, 01:50 AM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar
 thank you, interesting url.
I cleared my cache and temp internet files and my history and still no go.
I am going to add the snippett of coding you just psoted and see what happens. I ahve one page that does expire and I see no difference as to to coding why the others won't expire. I will keep you posted.
this has got me going in circles
Do you kno whow I can disable the backspace key? I know I can if I use window navigate etc. But I am using server-side coding.
I would think I would still be able to disable it on the window or document onload event.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Pages, Content Pages and CSS carliviris Visual Studio 2005 0 January 8th, 2008 05:56 PM
Using URL for new pages nloding Beginning PHP 2 July 10th, 2006 05:16 PM
session expiring? bodenzord BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 December 6th, 2004 02:52 AM
Web pages constructing: I-mode(mobile) pages karib Dreamweaver (all versions) 3 June 6th, 2004 09:48 AM
has more pages Louisa VB.NET 2002/2003 Basics 0 May 25th, 2004 10:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.