WPIntell

Source evidence

Does it support Wordfence donotcache() function ?

Vendi Cache · support · 2016-11-14T12:01:00+00:00

complaintsentiment
highseverity
1.0relevance
7replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 31 rows with source links

12.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

27 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
wordpresslover7 unresolved
Hey ! Does it support the wordfence::doNotCache() ? https://docs.wordfence.com/en/DoNotCache Hi wordpresslover7, In order for Vendi Cache to exist in an environment where Wordfence is also installed we had to rename anything that was Wordfence related for both technical and also legal reasons. We still have a little bit of code that has “Wordfence” in it (including a class with that name) but that will be going away soon. The very short and literal answer is that we cannot use that function exactly as is however we will be able to give you a different function that does the same exact thing. Currently there isn’t a function exposed but we’ve added that as a feature request and we should be able to push that out pretty soon. Until we push that change live, however, you can still use the built-in constants to tell us not to cache something. If at any point in your request pipeline you want to disable caching for a specific URL you can just set the global constant DONOTCACHEPAGE to true and we won’t cache anything: if( ! defined( 'DONOTCACHEPAGE' ) ) { define( 'DONOTCACHEPAGE', true ); } However, please note that setting this on something that was already previously cached will not un-cache it, you’ll need to manually do that and then we’ll begin to honor your command. Thanks, Chris Hey @chrisvendiadvertisingcom Has this function been introduced yet? I use it in my theme to tell wordfence/vendi cache not to cache pageviews counter. To be honest this is one of the main reasons I used wordfence cache followed by vendi cache. Fragment caching is a challange, wordfence::doNotCache() was a great solution while other caching plugins fail. Hi wordpresslover7, We are planning on releasing an incremental update next week sometime (probably Tuesday or Wednesday) with this and a couple of other smaller but important features and tweaks. Thanks, Chris Superawesome ! Preapring for after-Christmas donation 🙂 Hi wordpresslover7, (Santa brought me a Windows 10 BSOD that I had to play with) but we just released version 1.2.0 that implements this feature. https://wordpress.org/plugins/vendi-cache/changelog/ The preferred way to tell Vendi Cache to not cache a specific request is via a filter: add_filter( \Vendi\Cache\api::FILTER_NAME_DO_NOT_CACHE, '__return_true' ); We prefer the filter because it is overridable which makes testing easier. If you want, however, we still have a static public method that you can invoke (that actually still calls the filter): \Vendi\Cache\api::do_not_cache() If you have any questions about this just let me know! Thanks, Chris Hi Chris ! Finally I managed to test the new version. I added the api::do_not_cache() to the following request in my theme file. (I did it the same way in wordfence) <?php api::do_not_cache(); echo tie_views(); ?> This resulted in a fatal error. The request is to display non-cached views counter. Fatal error: Class 'api' not found in /example.com/wp-content/themes/sahifa/framework/parts/meta-archives.php on line 16 How should I apply the filter correctly using your preffered approach or/and static method in my case? This reply was modified 9 years, 4 months ago by wordpresslover7 . Can you try using the fully-qualified class name? \Vendi\Cache\api::do_not_cache()

Comments

7 shown
cjhaas 2016-11-16T21:06:00+00:00

Hi wordpresslover7, In order for Vendi Cache to exist in an environment where Wordfence is also installed we had to rename anything that was Wordfence related for both technical and also legal reasons. We still have a little bit of code that has “Wordfence” in it (including a class with that name) but that will be going away soon. The very short and literal answer is that we cannot use that function exactly as is however we will be able to give you a different function that does the same exact thing. Currently there isn’t a function exposed but we’ve added that as a feature request and we should be able to push that out pretty soon. Until we push that change live, however, you can still use the built-in constants to tell us not to cache something. If at any point in your request pipeline you want to disable caching for a specific URL you can just set the global constant DONOTCACHEPAGE to true and we won’t cache anything: if( ! defined( 'DONOTCACHEPAGE' ) ) { define( 'DONOTCACHEPAGE', true ); } However, please note that setting this on something that was already previously cached will not un-cache it, you’ll need to manually do that and then we’ll begin to honor your command. Thanks, Chris

wordpresslover7 2016-12-20T22:53:00+00:00

Hey @chrisvendiadvertisingcom Has this function been introduced yet? I use it in my theme to tell wordfence/vendi cache not to cache pageviews counter. To be honest this is one of the main reasons I used wordfence cache followed by vendi cache. Fragment caching is a challange, wordfence::doNotCache() was a great solution while other caching plugins fail.

cjhaas 2016-12-20T23:07:00+00:00

Hi wordpresslover7, We are planning on releasing an incremental update next week sometime (probably Tuesday or Wednesday) with this and a couple of other smaller but important features and tweaks. Thanks, Chris

wordpresslover7 2016-12-20T23:18:00+00:00

Superawesome ! Preapring for after-Christmas donation 🙂

cjhaas 2017-01-01T21:42:00+00:00

Hi wordpresslover7, (Santa brought me a Windows 10 BSOD that I had to play with) but we just released version 1.2.0 that implements this feature. https://wordpress.org/plugins/vendi-cache/changelog/ The preferred way to tell Vendi Cache to not cache a specific request is via a filter: add_filter( \Vendi\Cache\api::FILTER_NAME_DO_NOT_CACHE, '__return_true' ); We prefer the filter because it is overridable which makes testing easier. If you want, however, we still have a static public method that you can invoke (that actually still calls the filter): \Vendi\Cache\api::do_not_cache() If you have any questions about this just let me know! Thanks, Chris

wordpresslover7 2017-01-09T14:18:00+00:00

Hi Chris ! Finally I managed to test the new version. I added the api::do_not_cache() to the following request in my theme file. (I did it the same way in wordfence) <?php api::do_not_cache(); echo tie_views(); ?> This resulted in a fatal error. The request is to display non-cached views counter. Fatal error: Class 'api' not found in /example.com/wp-content/themes/sahifa/framework/parts/meta-archives.php on line 16 How should I apply the filter correctly using your preffered approach or/and static method in my case? This reply was modified 9 years, 4 months ago by wordpresslover7 .

cjhaas 2017-01-09T14:31:00+00:00

Can you try using the fully-qualified class name? \Vendi\Cache\api::do_not_cache()