Title: Preloading do not cache Cookie Notice plugin
Last modified: July 26, 2023

---

# Preloading do not cache Cookie Notice plugin

 *  Resolved [Bobosom](https://wordpress.org/support/users/bobosom/)
 * (@bobosom)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/)
 * Hello guys. Thank you for plugin.
 * I found weird behavior. I use plugin Cookie Notice & Compliance for GDPR / CCPA(
   [https://wordpress.org/plugins/cookie-notice/](https://wordpress.org/plugins/cookie-notice/)).
 * When is page cached after access from browser, cookie notice is there. But when
   is page preloaded, there is nothing from this plugin in preloaded html code. 
   Whole plugin code is missing.
 * I made some tests and changes in settings, but my knowledge is not enough.
 * Please help.

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

 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-16927514)
 * [@bobosom](https://wordpress.org/support/users/bobosom/) – you’ll probably want
   to use a different cookie plugin. One that detects if in an EU country using 
   JavaScript.
 * The PHP code that runs the cookie banner runs when the page is cached, which 
   is wherever your server is when it’s preloaded.
 * The [Jetpack cookie banner](https://jetpack.com/support/extra-sidebar-widgets/cookies-consent-banner/)
   works correctly. I primed the cache by loading a page from my US server and the
   banner still showed when I loaded it in the EU on my browser.
 *  Thread Starter [Bobosom](https://wordpress.org/support/users/bobosom/)
 * (@bobosom)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-16927750)
 * [@donncha](https://wordpress.org/support/users/donncha/)
 * Thank you for suggest. My site is only local thing and this simple solution was
   enough.
 * Right now I wanted to write about findings.
 * Cookie Notice & Compliance for GDPR / CCPA ([https://wordpress.org/plugins/cookie-notice/](https://wordpress.org/plugins/cookie-notice/))
   use something called Cookie_Notice_Bot_Detect. If Cookie Notice detect crawler
   in list of UserAgents, then do not show cookie baner. Between this crawlers is
   also WordPress. And that was a problem, because WordPress as UserAgent make preloading.
 * When I erased ‘WordPress\/’, then preloading worked.
 * Crawler list is in the file bot-detect.php.
 * I hope it will help to someone.
 *  Plugin Support [Alin (a11n)](https://wordpress.org/support/users/alinclamba/)
 * (@alinclamba)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-16953450)
 * Hi [@bobosom](https://wordpress.org/support/users/bobosom/),
 * Thank you for sharing those details. They might be helpful for others, indeed.
 * Best!
 *  [Frank](https://wordpress.org/support/users/t-mug/)
 * (@t-mug)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-17345559)
 * After having trouble with caching as well I had a look into the code.
 * Guys, are you aware that your plugin is absolutely incompatible with caching?
 * It’s even dangerous to use it since given consent from visitor 1 will be applied
   to visitor 2 and following ones. The only needed condition for reproducing this
   is that user 1 is the first visitor after a cache purge.
 * I cannot believe that this behaviour is undetected since the early days of the
   plugin. However, it should be the first sentence of your plugin description that**
   this plugin may lead to law violations and should never be used together with
   static page caching!**
 * Cheers.
    -  This reply was modified 2 years, 4 months ago by [Frank](https://wordpress.org/support/users/t-mug/).
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-17352138)
 * [@t-mug](https://wordpress.org/support/users/t-mug/) – You can possibly make 
   your cookie banner plugin work with caching enabled. I wrote a post many years
   ago about it.
 * [https://odd.blog/2018/07/20/wp-super-cache-and-cookie-banners/](https://odd.blog/2018/07/20/wp-super-cache-and-cookie-banners/)
    -  This reply was modified 2 years, 4 months ago by [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/).
 *  [Frank](https://wordpress.org/support/users/t-mug/)
 * (@t-mug)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-17352490)
 * Thanks. I’ve read the article. It’s much easier to disable caching at all – the
   practical effect is exactly the same.
 * This is because whether you need the cookie bar HTML which depends on a missing
   cookie which is checked on the server side by PHP – or you need the consent based
   JS code, which is only dumped into HTML when positively found a given consent
   by the cookie setting which is checked on the server side by PHP.
 * So whatever you configure in Cache settings – you’ll cause switching off caching
   at all.
 * The plugin does not work together with caching by design.
 * You’d keep away a lot of trouble, frustration and wasted time from plugin users
   pointing that out in the plugin description on wp.org
 * Cheers.
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-17353086)
 * How would you cache pages that use a cookie banner that uses PHP?
 * The cache key must include the same cookie that the cookie PHP code uses, which
   unfortunately creates a separate cache file. However, the visitor may still see
   a cached page that was generated by a previous visitor who chose the same cookie
   banner settings, as those settings are saved in the cookie.

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

The topic ‘Preloading do not cache Cookie Notice plugin’ is closed to new replies.

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

 * 7 replies
 * 4 participants
 * Last reply from: [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/preloading-do-not-cache-cookie-notice-plugin/#post-17353086)
 * Status: resolved