Вопрос

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

Это было полезно?

Решение

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).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top