I have the following problem: I have two webpages, a.php and b.php. The first page displays a list of items from a database, and the other page updates it and sends the user back to the previous page (by using window.history.back()).
However, when I go from a.php to b.php, update some entries in the database and go back, the list does not update without reloading the page manually. Is there any way that would allow me to either detect when the page is loaded as a result of a back button action and reload with JavaScript, or just tell the browser to update it automatically?
You could set a.php ‘s headers to forbid any kind of caching – that way, the browser should reload the page when it re-enters it.
The most relevant HTTP response headers are Cache-control and Expires.