The community member is looking for information on integrating a new CMS with a GraphQL API. They have questions about the mechanism for pushing content updates from the CMS to Web Studio, such as whether there is a webhook or if Web Studio fetches the content periodically or on every page view.
Another community member responds that Web Studio fetches the content in real-time, and recommends checking the documentation and watching tutorials. They mention that Web Studio uses Cloudflare Workers for caching, which respects the origin's cache control headers. The community members discuss how to configure the cache policy and that there is a feature request to allow setting custom cache control in the UI.
There is no explicitly marked answer, but the community members provide guidance on how Web Studio handles caching and content updates from the CMS.
Can you point me in the right direction for information on integrating a new CMS? I've got a graphql API (that can be tweaked if needed) that I'm confident I can get working with the query playground (looks like GraphiQL).
Specifically I'm wondering about the mechanism for pushing content updates from the CMS. Is there a webhook or something to notify Web Studio that there is a new item in a collection? Or does Web Studio fetch each collection periodically for updates? Or does Web Studio fetch the collection from the external CMS every time it needs it (so it is always fresh)? ...I have questions like this.
Thanks for your help. Any additional resources would be great. -Stefan
Yes, I was looking through https://docs.webstudio.is/university/foundations/cms and from a first look it all looks doable. My biggest question was just about what I asked above. So all dynamic content on the Web Studio page will be fetched realtime to the external CMS for every page view? (no caching?)
Right, I saw mention of CF workers. So you (Web Studio) are using CF workers, but could I get a high level idea of what they are doing for you? Is there a TTL it maintains so when there is an update in the CMS, the TTL expires (30s? 5min? 15min?) and then the latest content is fetched?
It respects the origin's cache control so what I'd do is make a request with a tool that lets you see the headers and inspect them to see what your origin is allowing
Right, that makes sense that it would just follow the origin cache control headers. Though you must be doing something a little more advanced than that with GraphQL as it is POST requests with the query in the body. As far as I know, http cache control headers don't play well with that. (and from playing around with web studio, the rendering seems too snappy to be going out to our [somewhat slow] origin server). Is there some more advanced/custom caching you're already doing with GraphQL requests? Using stale data and revalidating it (??).