keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Added cache_enabler_no_bypass_response filter #214

Closed janvitos closed 3 years ago

janvitos commented 3 years ago

With cache_enabler_no_bypass_response filter, we can choose NOT to bypass the cache for different response codes provided by the user in an array.

Example use of cache_enabler_no_bypass_response filter to bypass 404 pages:

add_filter( 'cache_enabler_no_bypass_response', 'ce_no_bypass_response' );
function ce_no_bypass_response( $response ) {
    $response = array(404);
    return $response;
}

This was created to address issue #213.