/    Sign up×
Community /Pin to ProfileBookmark

force page to NOT load from cache

I have a daily announcements page in my web site that is updated every day. When visitors come to the site and access the daily announcements page, I want the browser to NOT load the version from cache and instead want it to load the updated version of the page from the web server.

I tried using:
<meta http-equiv=”Pragma” content=”no-cache”>
<meta http-equiv=”no-cache”>
<meta http-equiv=”Expires” content=”-1″>
<meta http-equiv=”Cache-Control” content=”no-cache”>

But it doesn’t work. I’m at a loss for what else to try. Can anyone help me?

to post a comment
HTML

12 Comments(s)

Copy linkTweet thisAlerts:
@buntineFeb 19.2004 — Hmm. this is odd. They are in the <head> element arent they?

Is it an ASP page? if so, placing the following code at the top of the page will stop it from being stored in cache.

<i>
</i>response.expires = 0
Copy linkTweet thisAlerts:
@schristyauthorFeb 19.2004 — Yes, they are in the head section. See http://www.greenbayeasthighschool.com/morning_announcements.htm

This page is not an ASP page. All I'm doing is adding a hyperlink to the updated announcement page (pdf). When a person loads the page I want to make sure they see the updated page with the newly added link.

My home page (www.greenbayeasthighschool.com) has a SSI and I need to force that page to load fresh from the server each time too since the content on it changes daily. Any help you can give on that would help too.

Thanks much for taking time to help me with this.....


[i]Originally posted by buntine [/i]

[B]Hmm. this is odd. They are in the <head> element arent they?



Is it an ASP page? if so, placing the following code at the top of the page will stop it from being stored in cache.



<i>
</i>response.expires = 0
[/B][/QUOTE]
Copy linkTweet thisAlerts:
@CyCoFeb 19.2004 — ...you may want to try explicitly setting a date clearly in the past...

<META HTTP-EQUIV="expires" CONTENT="Wed, 19 Feb 2003 08:00:00 GMT">

or, since you have SSI capabilities...

<!--#modified expires="Wed, 19 Feb 2003 08:00:00 GMT" -->
Copy linkTweet thisAlerts:
@schristyauthorFeb 21.2004 — Is there any easier solution that wouldn't require me to change the date each day? I could do that. It's no big deal, I was just hoping there was a faster solution that I wouldn't have to edit each day. This would be fine for my morning announcement page, but for my home page It would defeat the purpose of having a SSI for my current events. I use a D-base with a SSI on the home page so that I don't have to edit and FTP the home page each day. The script I use allows others to enter events and have them appear automatically. Having to change the meta tag date and ftp the page each day defeats the purpose.

Thanks for your help. Anyone else out there have any ideas?



[i]Originally posted by CyCo [/i]

[B]...you may want to try explicitly setting a date clearly in the past...



<META HTTP-EQUIV="expires" CONTENT="Wed, 19 Feb 2003 08:00:00 GMT">



or, since you have SSI capabilities...



<!--#modified expires="Wed, 19 Feb 2003 08:00:00 GMT" --> [/B]
[/QUOTE]
Copy linkTweet thisAlerts:
@buntineFeb 21.2004 — As long as the date supplied in the META tag is before the current date, the page will not be stored in the cache.

So you would not have to edit the date each day.
Copy linkTweet thisAlerts:
@schristyauthorFeb 21.2004 — Hmmmm...clever...

I'll give it a try. Thanks.

[i]Originally posted by buntine [/i]

[B]As long as the date supplied in the META tag is before the current date, the page will not be stored in the cache.

So you would not have to edit the date each day. [/B]
[/QUOTE]
Copy linkTweet thisAlerts:
@schristyauthorFeb 23.2004 — For the page that includes an SSI do I put this in between the head tags or do I put it where the SSI appears in the page? Or does it not matter?


[i]Originally posted by schristy [/i]

[B]or, since you have SSI capabilities...



<!--#modified expires="Wed, 19 Feb 2003 08:00:00 GMT" --> [/B]
[/QUOTE]
Copy linkTweet thisAlerts:
@buntineFeb 23.2004 — It doesnt really matter, its good practise to put SSI statements at the top of the page though. Mainly for readability.

Of coarse, there are exceptions to this rule.
Copy linkTweet thisAlerts:
@schristyauthorFeb 23.2004 — Thanks Buntine. That worked perfectly. I appreciate your help!
Copy linkTweet thisAlerts:
@buntineFeb 23.2004 — No worries? CyCo was the one who helped you really.
Copy linkTweet thisAlerts:
@schristyauthorFeb 23.2004 — True....thanks to Cyco too!
Copy linkTweet thisAlerts:
@CyCoFeb 23.2004 — ...you're welcome, schristy...glad it worked for you...and great job, buntine, for explaining everything to schristy...

CyCo
×

Success!

Help @schristy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...