[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Kathy

4/19/2002 9:55:00 PM

Hi,
I developed some mobile internet applications using
mobile internet tool kit and ASP.net. During the testing
process, I usually have to make several changes and re-
access the pages several times in a short period of time
to test these changes. I noticed that I usually get the
old page instead of the updated one eventhough I did
disconnect and then reconnect to the page from my phone.
It seems like I have cache that keep the copy of the old
page in my phone.

So my question is do we have any way so I can script in
my code to make sure that it will always give a updated
page when user access it. In other words, to clear the
browswer cache.

Thanx!
-Kathy-
2 Answers

Craig Deelsnyder

4/21/2002 12:04:00 AM

0

Kathy,

Sorry for the email straight to you. I meant to respond to the group.
Here's my response that you should have received:

The best, easiest and most foolproof way (hint: I recommend it) is to
include a unique parameter in your URL. At one client, we used the current
time in UTC. A unique URL guarantees the page is loaded. Some browsers
such as IE 5.0 when it came out would resist every attempt by someone to
expire a page.

But if you want to do it similar to 'Old' ASP (pre-.NET) you used to have a
Response.Expires property you could set, and it was recommended to set it to
a negative number more than an hour in the past (daylight savings time!).
There are a couple HTTP headers you can set programmatically in the
Response:

Note this is not ASP.NET code! It may be the same thing in .NET, but I
don't know:
'date in the past...
Response.AddHeader "Expires", "Mon, 26 Jul 1997 05:00:00 GMT"
'always modified
Response.AddHeader "Last-Modified", Now & " GMT"
'HTTP/1.1
Response.AddHeader "Cache-Control", "no-cache, must-revalidate"
'HTTP/1.0
Response.AddHeader "Pragma", "no-cache"
'last ditch attempt!
Response.Expires = -1

Craig


"Kathy" <thytran@hotmail.com> wrote in message
news:428f01c1e7dc$2daabc70$a4e62ecf@tkmsftngxa06...
> Hi,
> I developed some mobile internet applications using
> mobile internet tool kit and ASP.net. During the testing
> process, I usually have to make several changes and re-
> access the pages several times in a short period of time
> to test these changes. I noticed that I usually get the
> old page instead of the updated one eventhough I did
> disconnect and then reconnect to the page from my phone.
> It seems like I have cache that keep the copy of the old
> page in my phone.
>
> So my question is do we have any way so I can script in
> my code to make sure that it will always give a updated
> page when user access it. In other words, to clear the
> browswer cache.
>
> Thanx!
> -Kathy-


(Simon Calvert)

4/23/2002 6:44:00 PM

0