View Full Version : How to force a page to fetch most recent data?

11-13-2002, 04:49 PM
Is it possible to force a page to fetch the most recent data from MySql rather than relying on a cached copy?

I have a problem that when the user updates the database and then returns to the page which shows the user the information just updated, the page is not reflecting the most recent changes. Only once the page has been refreshed will it show the most recent changes.

Is there anyway to force the page to "refresh itself" everytime it is accessed.

Any help will be greatly appreciated!

11-13-2002, 10:15 PM
This has nothing to do with MySQL, since the caching is done by the browser. Usually the user sets how often and when cached pages shall be returned.

You should be able to force the browser to reload the page if you redirect to the URL appended with a random value as a query string (try it with the current timestamp). When comparing yourFile.php?bla=123456789 with yourFile.php the browser sees a difference and tries to load the page anew.

Hope that helps.

11-13-2002, 11:03 PM
You could try adding the following between your <head></head> tags

<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">