|
 |
asp_databases thread: Cache of webpages
Message #1 by "Drew, Ron" <RDrew@B...> on Thu, 8 Aug 2002 17:40:46 -0400
|
|
Ken sent this code out a while ago to send the necessary HTTP headers to
the client to prevent the client browser from "caching" the webpage.
<%
Sub SetHeaders( _
)
Response.ExpiresAbsolute = #1/1/1980#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, must-revalidate"
' Add any other HTTP headers here
End Sub
%>
I have a problem in that my site has a new IP address. When I tried to
go to it via the way a user would http://www.blah.com (not the real
address) I had problems. Since XP will cache the DSN, I needed to do a
IPCONFIG /flushdsn at a command prompt to make my pc see the new
location.
Most users would not know to do this. My site starts with default.htm
and uses frames. The right frame is an ASP so the question is, can I
just put this code at the start of the ASP? And if so, how do I execute
the SUB. Can someone give me an example??? Thanks much
Message #2 by "Ken Schaefer" <ken@a...> on Fri, 9 Aug 2002 10:33:52 +1000
|
|
Hi there:
a) I don't think you are talking about DSN - you are talking about DNS. In
any case, your local DNS cache should be flushed fairly quickly - certainly
it will be cleared if you reboot your machine.
b) You could just paste the code at the top (or bottom) of your page, and
then to call it you would do:
<%
SetHeaders
%>
Personally though, I would put it into an include file (that way you can
re-use it on many pages), and do something like:
<% @Language=VBScript %>
<%
Option Explicit
%>
<!-- #include virtual="/inc/HTML/SetHTTPHeaders.asp" -->
<!-- #other include files go here -->
<%
' Now set HTTP Headers
Call SetHeaders()
' Now do other stuff
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Drew, Ron" <RDrew@B...>
Subject: [asp_databases] Cache of webpages
: Ken sent this code out a while ago to send the necessary HTTP headers to
: the client to prevent the client browser from "caching" the webpage.
: <%
:
: Sub SetHeaders( _
:
: )
:
: Response.ExpiresAbsolute = #1/1/1980#
:
: Response.AddHeader "pragma", "no-cache"
:
: Response.AddHeader "cache-control", "private, no-cache, must-revalidate"
:
: ' Add any other HTTP headers here
:
: End Sub
:
: %>
:
: I have a problem in that my site has a new IP address. When I tried to
: go to it via the way a user would http://www.blah.com (not the real
: address) I had problems. Since XP will cache the DSN, I needed to do a
: IPCONFIG /flushdsn at a command prompt to make my pc see the new
: location.
:
: Most users would not know to do this. My site starts with default.htm
: and uses frames. The right frame is an ASP so the question is, can I
: just put this code at the start of the ASP? And if so, how do I execute
: the SUB. Can someone give me an example??? Thanks much
:
:
Message #3 by "Drew, Ron" <RDrew@B...> on Mon, 12 Aug 2002 08:43:04 -0400
|
|
Thanks Ken..yes I did mean DNS and was not sure how the clearing
occurred. I will add this to my include as you mentioned. Thanks again
for your help.
-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: Thursday, August 08, 2002 8:34 PM
To: ASP Databases
Subject: [asp_databases] Re: Cache of webpages
Hi there:
a) I don't think you are talking about DSN - you are talking about DNS.
In any case, your local DNS cache should be flushed fairly quickly -
certainly it will be cleared if you reboot your machine.
b) You could just paste the code at the top (or bottom) of your page,
and then to call it you would do:
<%
SetHeaders
%>
Personally though, I would put it into an include file (that way you can
re-use it on many pages), and do something like:
<% @Language=3DVBScript %>
<%
Option Explicit
%>
<!-- #include virtual=3D"/inc/HTML/SetHTTPHeaders.asp" -->
<!-- #other include files go here -->
<%
' Now set HTTP Headers
Call SetHeaders()
' Now do other stuff
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Drew, Ron" <RDrew@B...>
Subject: [asp_databases] Cache of webpages
: Ken sent this code out a while ago to send the necessary HTTP headers
to
: the client to prevent the client browser from "caching" the webpage.
: <%
:
: Sub SetHeaders( _
:
: )
:
: Response.ExpiresAbsolute =3D #1/1/1980#
:
: Response.AddHeader "pragma", "no-cache"
:
: Response.AddHeader "cache-control", "private, no-cache,
must-revalidate"
:
: ' Add any other HTTP headers here
:
: End Sub
:
: %>
:
: I have a problem in that my site has a new IP address. When I tried
to
: go to it via the way a user would http://www.blah.com (not the real
: address) I had problems. Since XP will cache the DSN, I needed to do a
: IPCONFIG /flushdsn at a command prompt to make my pc see the new
: location.
:
: Most users would not know to do this. My site starts with default.htm
: and uses frames. The right frame is an ASP so the question is, can I
: just put this code at the start of the ASP? And if so, how do I
execute
: the SUB. Can someone give me an example??? Thanks much
:
:
|
|
 |