admin管理员组

文章数量:1186260

So i've made an extra menu item people see when they log on to the wordpress admin backend, and then go to the front-end. This works perfectly, except it doesn't when i set the cloudflare cache to Cache Level: Cache Everything. I need the Cache Level: Cache Everything because cloudflare will see it as DYNAMIC, and the site isn't as fast as i would like to.

Thus far I've tried this: / and I've tried manipulating the URL when logged in and bypassing that URL. Unfortunately, all these options didn't work. And it resulted in the user only seeing the extra menu item when manually force refresh the browser or when the cache expires.

Does someone have a brilliant idea so i can show the visitors the extra menu item on the frontpage whilst not having to compromise the caching.

So i've made an extra menu item people see when they log on to the wordpress admin backend, and then go to the front-end. This works perfectly, except it doesn't when i set the cloudflare cache to Cache Level: Cache Everything. I need the Cache Level: Cache Everything because cloudflare will see it as DYNAMIC, and the site isn't as fast as i would like to.

Thus far I've tried this: https://www.kevinleary.net/blog/cloudflare-caching-for-wordpress/ and I've tried manipulating the URL when logged in and bypassing that URL. Unfortunately, all these options didn't work. And it resulted in the user only seeing the extra menu item when manually force refresh the browser or when the cache expires.

Does someone have a brilliant idea so i can show the visitors the extra menu item on the frontpage whilst not having to compromise the caching.

Share Improve this question asked Jan 25 at 15:19 user9197703user9197703 91 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

You have to configure Cloudflare to always bypass the cache for logged in users.

You either need to switch to using Cloudflare APO for WordPress which handles disabling the cache for logged in WordPress users automatically (among many other things), or you could try creating a Cache Rule that checks if the user is logged in, by looking for a specific WordPress cookie or something, and disables the cache for those requests. I think you would look for a cookie with a name that starts with wordpress_ to determine if the user is logged into WordPress.

It looks like the website you linked has you setting up a Cache Rule that bypasses the cache for logged in users. Either you didn't configure that, or their recommended rule isn't working for some reason.

本文标签: wordpressBypass cloudflare cache when logged in to show extra menu item on frontpageStack Overflow