 |
| 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
|
|
|
|

October 30th, 2003, 10:54 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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"%>
|
|

October 31st, 2003, 03:00 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

October 31st, 2003, 07:19 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
tried it and they still don't expire.
this is crazy.:(
|
|

October 31st, 2003, 07:25 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 2nd, 2003, 12:03 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
what does the "Pragma" mean ??
|
|

November 2nd, 2003, 12:23 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 2nd, 2003, 01:31 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

November 2nd, 2003, 05:08 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|
|

November 2nd, 2003, 06:56 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

November 3rd, 2003, 01:50 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|
 |