[Support request] Setting no cache headers for specific pages

Home Forums Support Setting no cache headers for specific pages

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1272680
    Dexter

    I have an issue where users navigate through a page, log in, return to that page, and receive a cached version without logged in content. I need to turn off the caching for those pages. Adding the following to my functions.php file worked but it applies to all pages and makes my site slow. How can I apply this only to those pages, or only for logged in users? Thank you so much for any help on this.

    header(“Cache-Control: no-cache, no-store, must-revalidate”); // HTTP 1.1.
    header(“Pragma: no-cache”); // HTTP 1.0.
    header(“Expires: 0”); // Proxies.

    #1272683
    Dexter

    Preferably this would apply only to both logged in users who are on those pages.

    #1272930
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    How are you caching things? It’s likely something that needs to be adjusted inside your caching plugin/server caching configuration.

    The theme itself doesn’t do any caching.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.