• Resolved morespinach

    (@morespinach)


    Great plugin. Always works.

    Question: We use Nginx. I need browser (client) cache enabled for the time I specify in the config settings. So in Comet Cache we’ve enabled the client cache. Caching is for 7 days. We want this NOT ONLY for static assets, but for the entire Single, Category, etc web pages.

    However, this doesn’t work. When we check headers via CURL..

    The main URL: https://baystreetclinic.com/ comes back with:

    cache-control: max-age=86400

    And a category or single post URL: https://baystreetclinic.com/victory-skin-care/ comes back with:

    No caching header

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Raam Dev

    (@raamdev)

    Hey @morespinach,

    Browser caching is different from page caching, which is what Comet Cache does. The Pro version of Comet Cache has a feature to add the necessary .htaccess rules to enable browser caching, but that’s only for Apache web servers.

    For Nginx web servers you’ll need to edit your Nginx server configuration directly to enable browser caching. This article should help: https://www.howtoforge.com/make-browsers-cache-static-files-on-nginx

    If you don’t have access to your web server configuration files, you will need to have your web hosting company help you enable this for Nginx.

    I hope this helps!

    Thread Starter morespinach

    (@morespinach)

    That link for Nginx is explicitly for static assets like jpg or png or ico files. This already works for us, as I mentioned.

    But the PHP-generated ‘pages’ are what are in more control of WordPress. Nginx has its own proxy-cache already, which works for us, but it doesn’t do browser-side caching instructions. Any idea how to cache the PHP dynamic pages on the browser side too? I thought this is what Comet’s “client cache” does, not the static files stuff (which, between Nginx and Cloudfront, already happens spectacularly).

    Raam Dev

    (@raamdev)

    Yes, the Comet Cache Client-side Caching is different from browser caching. The client-side caching controls whether or not WordPress disables browser caching for dynamic WordPress-generated pages which is the default in WordPress since WordPress sites are generally dynamic and for that reason it would usually be bad to have the browser cache anything generated by WordPress.

    I would need to double-check the codebase (I’m on my phone at the moment) but I believe Comet Cache Simply disables the WordPress nocache_headers() function: https://codex.ww.wp.xz.cn/Function_Reference/nocache_headers

    When those are disabled, whatever headers the web server sets are what get set. I’m fairly certain Comet Cache does not explicitly set any headers for browser caching at all.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Client cache for all pages?’ is closed to new replies.