Join the Webstudio community

Updated 5 months ago

Clarify how caching of CMS resources works with Webstudio now (and in the future)

At a glance

The community member is trying to understand how caching works for a project hosted on Webstudio, which runs on a Cloudflare worker. They understand that the CMS API can use Cache-Control headers to reduce API calls, and without these headers, every pageview with CMS content would make a request to the CMS.

The community members discuss that Webstudio/worker respects the cache headers set by the CMS, and the CMS APIs typically have their own caching, making them very fast. There hasn't been further discussion about a custom override, but the community member is interested in this idea, especially for a use case with a lot of global traffic where Cloudflare's cache might be preferable to the CMS's caching.

The community members also discuss Baserow as a potential CMS, which doesn't seem to have an option for adding headers to its API responses, so the idea of a built-in custom override in Webstudio could be a solution. However, Baserow is considered a clunky CMS option, and the community member is only interested in it for managing other data alongside the CMS.

The Webstudio team acknowledges the community member's suggestions and says they won't be adding custom cache settings until they see a strong demand for it, but it could be

Useful resources
I've read some of the discussions about caching, and I'd like to check my understanding:

For a project hosted by Webstudio (therefore it's run in a Cloudflare worker), I understand that the CMS API can use Cache-Control headers to reduce API calls.

Without these headers, am I correct that every pageview with CMS content will make a request to the CMS?

Please correct me if I'm missing something in my understanding.

I also saw this comment https://discord.com/channels/955905230107738152/1133337749856989316/1228373118154702951

MAYBE we could have a manual override that is based on some simple logic like amount of hours to keep the cache instead of relying on headers.

I'm curious about whether this idea is being considered for the future, too!
J
p
O
5 comments
your take on it is correct. Webstudio/worker respects whatever cache headers the cms returns. The cms apis typically have their own caching going on so they are very fast.

There hasnt been further discussion about a custom override but curious to know why youd be interested in it
Thanks, John. Re the CMS's own caching: For a site with a ton of global traffic, I'm guessing that Cloudflare's cache would be preferable to a CMS's caching (unless that CMS was also globally distributed)? My use case is very small, so this is just hypothetical as I'm trying to wrap my ahead around things.

Re the custom override—I'm still looking at Baserow as a possible CMS, which doesn't seem to have an option for adding headers to its API responses, so the idea of a built-in thing in WS seemed like a solution.

(That said, Baserow is looking very clunky as a CMS option at this point. I'm only interested in it as a way to manage other stuff along with CMS.)
yeah most cmss will have a globally distributed CDN with its own caching. Baserow is good for some types of data but not rich text
All correct, we won't be adding custom cache settings until we see a strong demand for it, but generally it could be an interesting additional thing that could reduce CMS api cost at scale.
Add a reply
Sign up and join the conversation on Discord