Question on Cache Everything

caching

#1

Hello,
I have a WordPress site. If I want to cache everything and this still function properly do these page rules make sense? This is for resphealth.org

1: resphealth.org/wp-admin/*
-Cache Level: Bypass

2: resphealth.org/*
-Cache Level: Cache Everything
-Edge Cache TTL: 2 hours

Or will this somehow always bypass the cache since i’m bypassing wp-admin? One idea is to use a page caching plugin and so the /* will cache all the cached pages from the plugin while /wp-admin/* won’t affect that since those cached pages won’t hit /wp-admin ever.

We have a pro plan, not a business plan.

Thank you!


#2

That’s a good strategy.

The only way it’ll bite you is if someone who’s logged in starts crawling the site. Cloudflare will cache that version of the page. Sometimes with an Edit Tag, or that person’s name if they want to leave a comment (if your site has commenting enabled). People won’t be able to swoop in and have access to the other user’s profile. It just looks glitchy.


#3

How come I see so many uncached requests with these page rules? Being a Saturday there shouldn’t be any users really in the backend. Is there a way to tell what requests are the ones not being cached?


#4

Best would be to check the log on your origin server, and see which paths are most commonly requested. If it hits your origin, Cloudflare wasn’t able to serve it from cache.

Also note that Cloudflare doesn’t use a global cache, meaning every PoP will need to warm up its own.


#5

have a tool for that Warming Up Cache Geographically Using Webpagetest :grin:


#6

if I look at my server logs and see CFNetwork, am I too assume this is cloudflare trying to cache this resource?


#7

Not necessarily.

I checked your site and noticed the events section isn’t being served from cache. Is that intended and perhaps those pages are requested often?

What is your current ratio of cached/non cached requests?


#8

if your server logs show cloudflare network IP addresses, then you probably need to make sure you have restored visitors’ real IP addresses as per https://support.cloudflare.com/hc/en-us/sections/200805497-Restoring-Visitor-IPs

Also check out


#9

I did have a different page rule set for the /specialevents path to clear the cache more often… It did not have cache everything set because I thought the /* was doing that, but maybe it was overriding the /*. I’ve now set that and will see if that changes any results.

For the past 6 hours the cached/non-cached ratio is basically 50/50. I also don’t cache /wp-admin so anyone logged in will bypass the cache, but it was showing the same ratio in the middle of the night.

Is it possible having a caching plugin AND cloudflare is somehow causing cloudflare not to cache content? I really like the cache plugin I use as it does a great job. I was hoping cloudflare would just cache the html generated by that plugin.


#10

Ok update.
-I have turned off admin bar and any edit buttons.
-I set my WP cache to show even to logged in users
-One page rule: resphealth.org/* with browser cache ttl: 1 hour, cache everything, and edit cache ttl 16 hours
-When I view the home page in chrome and inspect the dev tools network tab, the top item is cf-cache-status: HIT. Great! BUT a lot of files below that (served from that domain) say cf-cache-status: MISS

Am I doing something wrong? Is there a header rule I’m missing on my site for those files?

Thanks so much!


#11

looks like those files are HITs now! I’ll keep this post updated once I’m confidant I have everything set as it should!


#12

I, use and works

  • wordpress/Cloudflare plugin and on Automatic Cache Management.
  • iThemes Security add white list CloudFlare ip: https://www.cloudflare.com/ips/
  • CloudFlare firewall add my hosting ip (I do not know whether it is important)
  • Disable wordpress themes admin bar/menu

Cloudflare page rule and cache options:

Speed: only disable rocket
Slow page download disables some javascript eg Dynamic Web Badges!
Then CloudFlare Cache process may slow down.
Other all acceleration is enabled.

Add widget Standard Web Badges
add footer Dynamic Web Badges

Sorry Google Translate!