Should Frontend Requests for Content be Proxied through our Backend Service to Sanity or just Query the Sanity API Directly from the Frontend?

2 replies
Last updated: Nov 9, 2021
Hello, my team is evaluating Sanity as a possible headless CMS API provider. We have a several FE applications (one where an adminstrator would configure content, one where the end user would see the content, and then a backend API service. My question is - is it recommended that FE requests for content be proxied through our backend service to Sanity or just query the Sanity API directly from the FE?
Nov 3, 2021, 3:42 PM
I guess it depends if all your data is public. We opted for no proxy and treat all data in Sanity as public knowledge
Nov 3, 2021, 5:04 PM
Another consideration is whether you expect heavy traffic. It's not terribly expensive to go over the limits on a plan, but it may still be worth adding a proxy to cache the Sanity contents. One of my projects already had an API requirement because the data is only semi-public (paywalled), so we've also implemented some caching that cut our Sanity API usage significantly.
Nov 9, 2021, 7:12 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?