0

I use Cloudflare heavily on all my sites. On https://pokerdiy.com I use the MyListings Theme which uses an AJAX login and Woo Commerce. The user never sees the default wordpress dashboards and control panels.

I now have caching issues with logged in users - My theory is that Cloudflare cannot determine when a user is logged in or not, so it is displaying the cached anonymous logged out view.

When I disable cloudflare the site works fine.

Reading on Cloudflare it sounds like "Bypass Cache by Cookie" is the only option to tell whether or not a user is logged in. However, this is a $200 Business license on Cloudflare which is out of the question for a hobby site.

https://support.cloudflare.com/hc/en-us/articles/218411427-Understanding-and-Configuring-Cloudflare-Page-Rules-Page-Rules-Tutorial- https://support.cloudflare.com/hc/en-us/articles/236166048 https://support.cloudflare.com/hc/en-us/articles/228503147-Speed-Up-WordPress-and-Improve-Performance

This is a long read, but halfway down someone suggests that the headers WP returns should be respected by CloudFlare: https://support.cloudflare.com/hc/en-us/articles/236166048

How can I use Cloudflare caching on a Wordpress site that uses front-end user logins?

0

I have found the answer there: http://jhewitt.net/2018/12/improving-wordpress-speed-with-cloudflare-workers/

Using Workers you can examine a request for WP cookies and exclude it from the cache. This solution works well as I have implemented it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.