Support » Fixing WordPress » How to NOT serve up cache pages?

  • I have some dynamic pages (dadabase) and I really need these pages to always reload from the database and not use any cache. I have placed some meta in the Head Section:

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">

    However, depending on the browser this doesn’t seem to work. Googling led me to some code to insert in the header.php (or child) file:

    <?php
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
    header('Cache-Control: no-store, no-cache, must-revalidate');
    header('Cache-Control: post-check=0, pre-check=0', FALSE);
    header('Pragma: no-cache');
    ?>

    Before I get too deep, I was looking for some direction on this. It’s more of a browser problem than wordpress, And certainly this must be rather common.

    How do people insure a page will regenerate from the database every time and not use cache (regardless of the browser)?

    Inquiring minds want to know

  • The topic ‘How to NOT serve up cache pages?’ is closed to new replies.