I have a multi-language website. My home page are the same in the 2 languages. The main language is English and the second language Portuguese. My concerned is that the home page in english is much slower than the home page in portuguese.
I compare both pages and the only think that is diferent is this:
English page:
<!-- Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/ Object Caching 520/1295 objects using Disk Page Caching using Disk: Enhanced (DONOTCACHEPAGE constant is defined) Content Delivery Network via N/A Lazy Loading
Portugueses page:
<!-- Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/ Object Caching 619/1135 objects using Disk Page Caching using Disk: Enhanced Content Delivery Network via N/A Lazy Loading
What am I doing wrong? is this ok?
I need to improve site performance.
Thanks
]]>as i test cache for both, one shows no problem at all, the other one shows error message “The pages do not match! Timestamps differ or were not found!”.as i check the log, one of the line shows log text as above – “DONOTCACHEPAGE defined. Caching disabled.” so far the only cache plugin i have installed is this one. so would like an asistance onj what should i look into to address this issue.
thanks in advance
]]>this might be a dumb question, but I haven’t been able to exclude a page from being cached. I want to exclude the file ‘page-users.php’. I went to Page cache > Never cache the following pages and tried adding a regexp based on the example on the FAQ.
Following the example on the website it should be */users
but this gives a regexp error, so I replaced it with:
page-users\.php
I also addded define('DONOTCACHEPAGE', true);
inside the file page-users.php
. For some reason the debugging is also not working so I can’t really validate if it works properly or not. Some examples on the website would be nice!
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.
]]>Is there a way to tell WP Fastest Cache via PHP to not cache a page? Like setting a flag if a certain page which we dont want cached is being loaded?
]]>WP Optimize page cache - https://getwpo.com - page not served from cache because: In the settings, caching is disabled for matches for one of the current request's GET parameters
At the and of page I found:
WP Optimize page cache - https://getwpo.com - page NOT cached because: DONOTCACHEPAGE constant or wpo_can_cache_page filter forbade it
I’m a WordPress plugin developer and am trying to add compatibility of my plugin with your plugin.
Specifically the renamed login page function.
I’m trying to identify when the user is in the custom login page, not to the page cache, but without success.
I tried all the methods on this page: https://wordpress.stackexchange.com/questions/12863/check-if-wp-login-is-current-page
Or maybe you want to make things easier for us and set DONOTCACHEPAGE on the login page.
DONOTCACHEPAGE is compatible with most cache plugins:
* WP Super Cache
* W3 Total Cache
* WP Rocket
* Autoptimize
* SG Optimizer
* Comet Cache
Thanks.
]]>I would like to exclude certain pages from caching programmatically. But it seems that your plugin doesn’t make use of the DONOTCACHEPAGE constant used by other popular caching plugins like WP Super Cache, W3 Total Cache, or WP Rocket among others.
As far as I know you don’t have any filter for it either, please correct me if I’m wrong.
I would thank you very much if you can add support for DONOTCACHEPAGE or at least add a new filter for caching exclusion, as you did already for minify or async loading features.
I would be happy to contribute with a patch if you have a Github repo for it.
]]>I would like to exclude certain pages from caching dynamically using DONOTCACHEPAGE constant. As you may know this is a constant supported by most caching/optmization plugins, for example:
* WP Super Cache
* W3 Total Cache
* WP Rocket
* Autoptimize
* SG Optimizer
* Comet Cache
But for some reason WP Fastest Cache doesn’t support it
Looking at the plugin code I can see it’s only accepted on a very specific use case, pages with 503 error when Wordfence is active:
// for Wordfence: not to cache 503 pages
if(defined('DONOTCACHEPAGE') && $this->isPluginActive('wordfence/wordfence.php')){
if(function_exists("http_response_code") && http_response_code() == 503){
return $buffer."<!-- DONOTCACHEPAGE is defined as TRUE -->";
}
}
Would be great if you can add support to exclude any page where DONOTCACHEPAGE is set to true, no matter if Wordfence is enabled or if it’s a 503 error page.
You would need only to remove the extra checkings from that if statement, or add a new one before it with only DONOTCACHEPAGE checking if you don’t want to change the above snippet. I would love to submit a pull request if you have a Github repo (I was unable to find any).
Being your caching plugin so popular, I’m sure many users would be happy of seeing this added.
Thanks!
]]>I have a WP install which uses PolyLang to provide the infrastructure that allows us to run two sites off of one install (in a virtual sense) — the default is English on an English domain and the other a French translation on a ‘French’ domain.
The English version is cached normally and performs like lightning! The French pages however have a long TTFB because they are served uncached.
I believe this is because PolyLang needs to set a cookie on the translated site so that it can remember which language is selected. In order to do so, it sets the DONOTCACHEPAGE constant, thereby preventing the page from being cached.
If I could direct your attention to this page you’ll find a discussion kicked off by the author of the WP Rocket plugin. Whilst it is a different caching plugin, the issue appears to remain the same, and the solution (scroll right down to the bottom) looks equally portable.
I’d love to hear your thoughts on this and whether you will be able to roll a solution into a nearby update.
]]>