admin管理员组

文章数量:1404560

I use Cloudflare heavily on all my sites. On 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.

This is a long read, but halfway down someone suggests that the headers WP returns should be respected by CloudFlare:

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

I use Cloudflare heavily on all my sites. On https://pokerdiy 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/hc/en-us/articles/218411427-Understanding-and-Configuring-Cloudflare-Page-Rules-Page-Rules-Tutorial- https://support.cloudflare/hc/en-us/articles/236166048 https://support.cloudflare/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/hc/en-us/articles/236166048

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

Share Improve this question edited Jan 13, 2020 at 23:02 Rodney asked Jan 13, 2020 at 22:29 RodneyRodney 1337 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I have found the answer there: http://jhewitt/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.

本文标签: cacheUsing Cloudflare caching on wordpress with frontend user logins