Cornerstone/Pro sets DONOTCACHEPAGE on public WooCommerce product pages (causing Cache-Control: no-store/private)

I’m seeing public WooCommerce product pages being served with WordPress no-cache headers:

  • Cache-Control: no-cache, must-revalidate, max-age=0, no-store, private
  • Expires: Wed, 11 Jan 1984 05:00:00 GMT

This happens at origin (not Cloudflare). Here’s the proof from the server (secure note)

Question: Why are these Cornerstone hooks firing on public WooCommerce product pages, and is there a supported setting/filter to prevent Cornerstone from setting DONOTCACHEPAGE on normal front-end requests (while still keeping the builder/preview un-cached)?

If there’s a recommended way to allow caching for logged-out visitors on product pages, please share the official approach.

Thanks!

Hey @fxground,

Please try adding the following code in your child theme’s functions.php.

add_action('init', function() {
  if (!is_admin() && !defined('CS_APP') && !did_action('cs_preview_frame_load')) {
    remove_action('cornerstone_before_boot_app', 'cs_disable_caching_for_app');
    remove_action('cornerstone_before_custom_endpoint', 'cs_disable_caching_for_app');
  }
}, 1);

Please note that it’s just a workaround or a test if it’ll work. If it resolves the issue you’re having, we’ll list this as an improvement to be done.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.