Join the Webstudio community

Updated 5 months ago

Does Cloudflare cache dynamic pages when using headless wordpress

At a glance

The community members are discussing the use of WordPress as a headless CMS and the hosting requirements. The main points are:

- WordPress caches content, but the cache lifetime is not guaranteed, so it can refresh the cache at any time.

- The caching behavior depends on multiple factors, such as the cache headers sent by the WordPress API and the Cloudflare cache lifetime settings.

- There is no guarantee that the content will be cached, so the number of requests to the headless WordPress server may not be 1:1 with the number of visits to the website.

- The community members suggest that the ratio of requests to the headless WordPress server and the number of website visits can be much less if WordPress allows caching. They mention a plugin that may be useful for controlling the cache, but the community member has no experience with it.

Useful resources
Hi, trying to get my head around the use of Wordpress as a headless CMS and the hosting requirements for the Wordpress. i.e. does every visit to the Webstudio page load the content from Wordpress or will the first load be cached by Wordpress ? and not request again until the page cache expires/page changes.
Example if the URL get's 500 vists a day will that request the content from the headless Wordpress 500 times or only the first time (providing the content doesn't change in the day).
Thanks!
O
H
J
6 comments
it caches, but cache lifetime is not guaranteed, so it can refresh the cache any time
it depends on multiple factors, starting with cache headers your wordpress api is sending and cloudflare cache lifetime setttings
Thanks, thought there would be lots of caveats but that does mean it's defintely not 1:1 so the WP headless server doesn't have to handle anything like the full traffic to the WEbStudio website, am I correct on that ?
It really depends on what WordPress allows to be cached. If it doesn't allow any cache, then it would be 1:1 for pages that load data from WordPress. If however it does allow cache, then the ratio would be much less. You can control the cache on WordPress. I just did a quick search and found a plugin that may be of use, but i have zero experience with it https://wordpress.org/plugins/wpgraphql-smart-cache/
Added this issue to allow you to override cache. follow along https://github.com/webstudio-is/webstudio/issues/4077
Add a reply
Sign up and join the conversation on Discord