add_headers with woocommerce customers turns off cache
-
In the method add_headers that decides if the user should get pages served from cache, the if statement incorrectly determines a woocommerce customer thats logged in should not received cached pages.
/wp-content/plugins/sg-cachepress/core/DNS/Cloudflare.php: Line ^72
if ( is_admin() || \is_user_logged_in() || ( function_exists( 'is_cart' ) && \is_cart() ) || ( function_exists( 'is_checkout' ) && \is_checkout() ) || ( function_exists( 'edd_is_checkout' ) && \edd_is_checkout() ) ) { header( 'Cache-Control: no-store, no-cache, must-revalidate, max-age=0' ); header( 'Pragma: no-cache' ); header( 'Expires: ' . gmdate( 'D, d M Y H:i:s \G\M\T', time() ) ); header( 'SG-Optimizer-Cache-Control: no-store, no-cache, must-revalidate, max-age=0' ); return; }
Woocommerce customers that are logged in SHOULD receive cached pages minus the is_cart and is_checkout checks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘add_headers with woocommerce customers turns off cache’ is closed to new replies.