Exclude URL with the constant DONOTCACHEPAGE
-
Many caching plugins use the constant DONOTCACHEPAGE to prevent caching of current URL. It’ll improve compatibility with some plugins (including WooCommerce even it is already excluded by server rules).
I’m testing following code and it works:
add_action( 'template_redirect', array( $this, 'donotcachepage' ), 9999 );
public function donotcachepage() { if ( headers_sent() || ! defined( 'DONOTCACHEPAGE' ) ) { return; } header( 'X-Cache-Enabled: False', true ); }
It’ll be nice to you add this feature request in next release.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Exclude URL with the constant DONOTCACHEPAGE’ is closed to new replies.