Title: Does it support Wordfence donotcache() function ?
Last modified: November 14, 2016

---

# Does it support Wordfence donotcache() function ?

 *  [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * (@wordpresslover7)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/)
 * Hey !
 * Does it support the wordfence::doNotCache() ?
 * [https://docs.wordfence.com/en/DoNotCache](https://docs.wordfence.com/en/DoNotCache)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Contributor [cjhaas](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * (@chrisvendiadvertisingcom)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8445471)
 * 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
 *  Thread Starter [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * (@wordpresslover7)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8574342)
 * Hey [@chrisvendiadvertisingcom](https://wordpress.org/support/users/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.
 *  Plugin Contributor [cjhaas](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * (@chrisvendiadvertisingcom)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8574374)
 * 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
 *  Thread Starter [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * (@wordpresslover7)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8574400)
 * Superawesome ! Preapring for after-Christmas donation 🙂
 *  Plugin Contributor [cjhaas](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * (@chrisvendiadvertisingcom)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8608030)
 * 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/](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
 *  Thread Starter [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/)
 * (@wordpresslover7)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8634194)
 * 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, 5 months ago by [wordpresslover7](https://wordpress.org/support/users/wordpresslover7/).
 *  Plugin Contributor [cjhaas](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * (@chrisvendiadvertisingcom)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8634241)
 * Can you try using the fully-qualified class name?
 * `\Vendi\Cache\api::do_not_cache()`

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Does it support Wordfence donotcache() function ?’ is closed to new replies.

 * ![](https://ps.w.org/vendi-cache/assets/icon-256x256.jpg?rev=1529164)
 * [Vendi Cache](https://wordpress.org/plugins/vendi-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/vendi-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/vendi-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/vendi-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/vendi-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/vendi-cache/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [cjhaas](https://wordpress.org/support/users/chrisvendiadvertisingcom/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/does-it-support-wordfence-donotcache-function/#post-8634241)
 * Status: not resolved