/    Sign up×
Community /Pin to ProfileBookmark

how to cause a page to work with the most up to date content

Hello

I have two files.
one.php and two.html
one.php leads to two.html via a link.

one.php has some php code that runs at the top of the page.
When the user clicks on the link and goes to two.html and then clicks on the ‘back’ arrow in the browser, one.php is displayed again, but the php code in that page doesn’t run again. Instead the page is rendered from the browser cache.

I have set the following tags in one.php:

[code=php]
<?php header(“Cache-control: private”); // IE 6 Fix. ?>
<meta http-equiv=”Cache-Control” content=”no-cache, must-revalidate”>
<meta Http-Equiv=”Pragma” Content=”no-cache”>
<meta Http-Equiv=”Expires” Content=”0″>
[/code]

This doesn’t help.
Is there a way to cause the page to be always parsed even though the user used the navigation arrows to reach it?

thanks in advance

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@davidklonskiauthorApr 19.2004 — [code=php]
header("Expires: ".time());
header("Last-Modified: ".time());
header("Cache-Control: no-cache, must-revalidate, private");
header("Pragma: no-cache");
[/code]

will do the trick
×

Success!

Help @davidklonski 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,
)...