Guest page caching

nodle

Well-known member
Does anyone have a walkthrough on setting up guest page caching using Cloudflare without using @digitalpoint app? His app works great (I have used it before) but I want to manually set it up in Cloudflare myself. I know it has something to do with excluding cookies like this:

1690943790332.webp

Does anyone have the full screenshot of what to add under Cloudflare to cache the html? Thanks. :)
 
Does anyone have a walkthrough on setting up guest page caching using Cloudflare without using @digitalpoint app? His app works great (I have used it before) but I want to manually set it up in Cloudflare myself. I know it has something to do with excluding cookies like this:

View attachment 289381

Does anyone have the full screenshot of what to add under Cloudflare to cache the html? Thanks. :)
That will handle the Cloudflare side.

There are some other intricacies you will need to handle/build on the application (XenForo) side for it to work properly:
  • Cache request only if it’s a GET
  • Check the content type and don’t cache things like JSON
  • This is the most important… Handle CSRF tokens that are always invalid/expired in cached pages (AJAX and POST requests won’t work for guests otherwise… including important things like being able to log in)
  • Watch out for gotchas if you allow more than 1 style or language selection
  • If you use Advanced cookie consent, you need to handle that on your end somehow
  • Flush the cache as needed when new content is created (for example a new post in a thread)
 
Thanks for the help @digitalpoint . I thought it was going to be like something IPS uses:

11.jpg.2765a931918ffe22383ad1e8775f49ae.webp

But it seems a little more complicated with Xenforo, so maybe I'll just install your app and go the easier route.
 
Thanks for the help @digitalpoint . I thought it was going to be like something IPS uses:

View attachment 289383

But it seems a little more complicated with Xenforo, so maybe I'll just install your app and go the easier route.
No idea about IPS, but ya… if you want to do it right where you aren’t just blindly caching everything and causing issues mentioned above, there’s things you also need to do on the server-side (PHP) as well as client-side (JavaScript). If it was as simple as something you only need to do in Cloudflare, Cloudflare would have a button you could flip on their side.
 
If it was as simple as something you only need to do in Cloudflare, Cloudflare would have a button you could flip on their side.
Well tell them to get on it lol :p, thanks for the explanation. I appreciate you clearing it up.(y)
 
Well tell them to get on it lol :p, thanks for the explanation. I appreciate you clearing it up.(y)
They can’t because it requires them to do things on your server. And every framework/platform/application is going to work differently, so I’m not sure you would want them to try and do that even if they could. Hah
 
@digitalpoint while were on the subject, what do you recommend setting Browser Cache TTL to? I have always used 4 hours, but I see a lot of people recommend 'Respect Existing Header'. What do you recommend. The only thing I have enabled at the moment is Redis cache. Thanks!

Image 8-2-23 at 6.37 AM.webp
 
@digitalpoint while were on the subject, what do you recommend setting Browser Cache TTL to? I have always used 4 hours, but I see a lot of people recommend 'Respect Existing Header'. What do you recommend. The only thing I have enabled at the moment is Redis cache. Thanks!

View attachment 289405
There isn’t a right answer. I have Cloudflare respect existing headers and handle it at the web server level.
 
Top Bottom