Thread Starter
border
(@border)
I have found the instruction for WP Rocket.
https://docs.wp-rocket.me/article/141-overriding-donotcachepage-constant-via-filter
It can be used for Cache Enabler or not? (Helper Plugin)
Thread Starter
border
(@border)
I see these lines in the file of a plug-in ( in cache_enabler.class.php):
// DONOTCACHEPAGE check e.g. woocommerce
if ( defined(‘DONOTCACHEPAGE’) && DONOTCACHEPAGE ) {
return true;
}
I want that this code wasn’t cached:
<?php
define( ‘DONOTCACHEPAGE’, true );
$o[‘charset’] = “UTF-8″;
if (!defined(‘_SAPE_USER’)){
define(‘_SAPE_USER’, ”);}
require_once($_SERVER[‘DOCUMENT_ROOT’].’/’._SAPE_USER.’/sape.php’);
echo “<!–check code–>”;
$o[‘force_show_code’] = true;
$sape = new SAPE_client($o);
echo $sape->return_links();
unset($o);
echo “<!–check code–>”;
?>
But it doesn’t work. What do I have to make?
Instructions aren’t currently provided for this as every use-case is different and implementing it requires a bit of technical knowledge. There have been a couple of threads in the past with the same sort of request, perhaps these will help:
https://wordpress.org/support/topic/how-to-exclude-cpt-archive-from-cache/
https://wordpress.org/support/topic/filters-bypass_cache-not-working/
Thread Starter
border
(@border)
This code in /wp-content/plugins/cache-enabler/inc/cache_enabler.class.php:
// DONOTCACHEPAGE check e.g. woocommerce
if ( defined(‘DONOTCACHEPAGE’) && DONOTCACHEPAGE ) {
return true;
}
or this
// bypass cache hook
if ( apply_filters(‘bypass_cache’, false) ) {
return true;
}
Do I need to duplicate this in functions.php or not?
wp-content/themes/videozoom4/functions.php
Unfortunately this is difficult for me. If I use bypass cache hook – which code should I use?
You can likely use the bypass_cache filter to bypass what you need although as previously stated this isn’t something we can provide support for as each use case is different. You may need to contact a web developer to take a closer look at your setup if required.