Link to home
Start Free TrialLog in
Avatar of rickh082997
rickh082997

asked on

Do not cache

Is there a way to force a page to not be cached. The page contains some dynamic data from a database which should never be cached. This needs to work for Netscape 4.0+ and IE 4.0+
Thanks, RickH
Avatar of punker
punker

<META http-equiv="Pragma" CONTENT="no-cache">
or
<META http-equiv="Cache-Control" CONTENT="no-cache"> maybe?

The first one is used commonly. The second one came from a book I have, and I'm not too sure about it.
Haha, punker, maybe? Maybe yes, both can be used (or must be used) ;). Though you might also wanna add this

<META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 22 1990 10:30:00 GMT">

So you'll need these three things in your page in the <head> tags and things should be solved.

Joseph
I don't know. I tried using these on a CF page, and they didn't work. I know they're meant to work, but in my experience, they do nill.
mmmm, interesting....I'll check it out...
I have the same problem when using location.href='mypage.htm' even when adding all the no cache stuff.
Avatar of rickh082997

ASKER

FYI, I am doing this in Cold Fusion also.
RickH
Rick: In that case, it will not reload the data on the page to reflect changes unless you surf to the page a second time or hit reload. That's my experience with it.
Try attaching a unique querystring to the url, even if it does not do anything.  It will force a cache.

i.e. in ASP you can do:

<%
  TimeStamp = Now
%>
:
<a href='something.htm?Timestamp=<%=Timestamp%>'>

Works for me.
I have placed suggestions for site visitors to set their browser to check for a new page everytime.

In IE5 this is in the "Tools" menu, "Internet Options", "General" tab, "Temporary Internet Files", "Settings" button. Under "Check for New Versions of Stored Pages" have the "Every Visit to the Page" radio button selected.

In Netscape 4.7 this is under "Edit", "Preferences", "Advanced", "Cache", then on the right side of the box, under "Document in cache is compared to document on network" choose the radio button labeled "Every Time".

I realize that it is less desireable than setting up the page for no cache, but the user will benefit by getting newest pages always.

Thanks, but I must force the no-caching myself.
why do you. if you give the reason for this it may be easier to find an alternative sollution...
ASKER CERTIFIED SOLUTION
Avatar of ahchong
ahchong

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ahchong > see our first comments....first read the other comments then answer when really necessary. Best to comment too....

Joseph
Sorry about that answer, I realy don't know that I have checked the answer radio button. Sorry about that ...
Yeah, all the newbies do that, you R forgiven, my friend.....but next time, first read the comments so no double comments are made or answers are given with the same content as the previously given comments...ok?

Joseph
rickh> hmmm, I sure do think that punker deserved these points.

ahchong > lucky for you

Joseph