最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Fully caching Wordpress site by CDN (eg. Cloudflare)

programmeradmin0浏览0评论

Because of random high traffic on our website, for which even total cache is not good enough (~ 1000 req/s) we would like to put CDN in front of the whole site. Cloudflare CDN caching seems to do the job with following issues:

  1. Once a page is cached without admin menu bar, admins don't see the menu bar.
  2. Once a page is cached with admin menu bar (by admins), regular users see menu bar even though they shouldn't.

This could be solved by rendering hidden admin menu bar in all cases, but showing it later by JS. Is there a way to achieve this? show_admin_bar(true), but that only shows the bar without any links. I would need this bar to render all admin links to be usable when unhiding it for the admins.

Because of random high traffic on our website, for which even total cache is not good enough (~ 1000 req/s) we would like to put CDN in front of the whole site. Cloudflare CDN caching seems to do the job with following issues:

  1. Once a page is cached without admin menu bar, admins don't see the menu bar.
  2. Once a page is cached with admin menu bar (by admins), regular users see menu bar even though they shouldn't.

This could be solved by rendering hidden admin menu bar in all cases, but showing it later by JS. Is there a way to achieve this? show_admin_bar(true), but that only shows the bar without any links. I would need this bar to render all admin links to be usable when unhiding it for the admins.

Share Improve this question asked Sep 22, 2019 at 9:28 VojtěchVojtěch 1011 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

Are you able to try this?

https://community.cloudflare/t/wp-admin-bar-being-cached-and-served-to-users/64797

There are a few more tips here:

https://ttfb.io/blog/how-to-set-up-cloudflare-to-cache-wordpress-pages/

发布评论

评论列表(0)

  1. 暂无评论