Jump to content

How to force no-cache


Manaus
 Share

Recommended Posts

Hello,

I have a page making ajax calls, but when I go back and forth with the browser I see just the cache content. Is there any way to prevent this?

I tried with all the meta tags available on the market today...

Link to comment
Share on other sites

Perhaps it will help to add these headers (just after the opening <?php call) to the top of your template file that is delivering the data to ajax

if($config->ajax) {
    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...