Ask a Question
Advertise on boostr.in
how to force page not to be cached in php using -'php'
how to force page not to be cached in php ¬†using -'php'
I have a page, index.php, that shows information based on a mysql db. ¬†There are forms on it, and the action for the forms is set to a separate page called process.php. ¬†Process.php does all the database CRUD stuff, then uses
to send the user back to the original page.
This seems to be working fine, except for the fact that the original index page doesn't always reflect the changes made by process.php. ¬†I assume that the page is being cached, because if I do a refresh (Ctrl + F5), the page will show the latest data.
How can I prevent this page from being cached? ¬†I have tried what the PHP page for header() says, but it doesn't seem to work. ¬†The Cache-Control and Expires options seem to have no effect at all - the page is still being cached.
Ok, I was partially wrong. ¬†Apparently, the following does work in IE:
<?php header("Cache-Control: no-cache, must-revalidate");
However, it is definitely NOT working in FF, which is still showing a cached version. ¬†Any ideas on why this is, and how I can make it stop caching?
Sep 7, 2015
to add a comment.
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please