Question

I created a guestbook using php. When I save an entry in the guestbook and the user gets a success message with a link "Back to guestbook". But if I click on the link, it doesn't load the new entry. How can I force to reload the page?

I tried location.reload(); but if I use that, the page doesn't stop to load.

Can anybody help me?

Shivan

Était-ce utile?

La solution

You need to reset the caching headers for that files:

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Last-Modified: Tue, 15 Nov 1794 12:45:26 GMT");

Make sure your webserver is not overwriting the caching headers for that files.

You might also want to check why the webserver wants the browser to store dynamic content in the cache (eg. why it caches .php-files).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top