Title: Cache Exception Rules Don&#8217;t Work
Last modified: August 2, 2022

---

# Cache Exception Rules Don’t Work

 *  Resolved [stirate](https://wordpress.org/support/users/stirate/)
 * (@stirate)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/cache-exception-rules-dont-work/)
 * Hello,
 * I currently have your plugin enabled and it works very well! The only issue is
   that it caches my login page and login modal (if the user doesn’t get sent to
   a dedicated login page). When these pages are cached and a user logs in with 
   them, the login either doesn’t work at all or only works once they go to other
   pages. When cache is disabled through your plugin, everything works perfectly(
   when users login with the modal or dedicated login page, the pages refresh and
   they’re logged in correctly).
 * The login modal is located at: [https://website.com/#user_login_modal](https://website.com/#user_login_modal)
   
   The dedicated login page is located at: [https://website.com/account/login](https://website.com/account/login)
 * Sometimes, the login page will have a redirect as well, which looks like this:
   
   [https://website.com/account/login/?redirect=https%3A%2F%2Fwebsite.com%2Fsubmit-listing%2F](https://website.com/account/login/?redirect=https%3A%2F%2Fwebsite.com%2Fsubmit-listing%2F)
 * These are the lines I’ve added in the “Prevent the following URIs to be cached”
   section, and none of them seem to work.
 * /*account/login*
    /*account/login/* *user_login_modal* /*login*
 * I’d love to get the modal and dedicated login page (with and without redirects
   in the ?URL) to cache correctly, so I can continue to use this amazing plugin.
 * Any help is appreciated!
 * Thank you!

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

 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/cache-exception-rules-dont-work/#post-15880583)
 * Hi,
    first of all login modal cannot be bypassed as it’s nothing but a hidden
   content in the page that gets activated via JS when someone clicks on the button
   or something. So, you can’t tell a system that cache the page but don’t cache
   the modal.
 * If you want that modal not to be cached, you need to bypass cache for that whole
   page.
 * > These are the lines I’ve added in the “Prevent the following URIs to be cached”
   > section, and none of them seem to work.
   >     ```
   >     /*account/login*
   >     /*account/login/*
   >     *user_login_modal*
   >     /*login*
   >     ```
   > 
 * – You have added wrong rules. If you want to bypass cache for `https://website.
   com/account/login` then the rule should be something like this:
 * `/account/login*`
 * Again as I said adding `user_login_modal` won’t help as that is not a query string
   with which the page loads and the system can see that the page has the `user_login_modal`
   query parameter so let’s Bypass cache for that.
 * Instead, it’s added as an anchor jump – which mostly gets activated as someone
   clicks on a button or link and the JS does the rest.
 * I hope this makes things clear.
 *  Thread Starter [stirate](https://wordpress.org/support/users/stirate/)
 * (@stirate)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/cache-exception-rules-dont-work/#post-15892678)
 * Hello,
 * That worked for the specific URL. Do you have any way to bypass cache on specific
   cookies? When the wordpress_logged_in cookie is set on my custom login modal (
   as referenced above), cloudflare still caches the page.
 * I can confirm that when logging in through the modal, the wordpress_logged_in
   cookie does get set.
 * Thank you for everything! Great support 🙂
 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/cache-exception-rules-dont-work/#post-15895121)
 * > Do you have any way to bypass cache on specific cookies? When the wordpress_logged_in
   > cookie is set on my custom login modal (as referenced above), cloudflare still
   > caches the page.
 * – If you have a site where general users gets to login to your site – it is highly
   recommended that you use the Worker mode instead of the default page rule mode
   and you will get those feature you have mentioned.

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

The topic ‘Cache Exception Rules Don’t Work’ is closed to new replies.

 * ![](https://ps.w.org/wp-cloudflare-page-cache/assets/icon-256x256.gif?rev=3234997)
 * [Super Page Cache – Cloudflare Cache, Page Speed & Core Web Vitals](https://wordpress.org/plugins/wp-cloudflare-page-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cloudflare-page-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [iSaumya](https://wordpress.org/support/users/isaumya/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/cache-exception-rules-dont-work/#post-15895121)
 * Status: resolved