Performance, caching, limits and errors
Read this page before you take your website live.
Calling from the browser (CORS)
Every path under /v2/public/cms/ returns Access-Control-Allow-Origin: * for every domain, so your website can call it directly from the browser, with no intermediate server.
Conditions:
- Do not send cookies or credentials: use
credentials: 'omit'(or thefetchdefault for cross-origin requests). The API does not allow credentials. - Do not add any headers (including
Authorization,Content-Typeor your ownX-…headers). AGETrequest with no headers is a "simple request": the browser sends it directly, without anOPTIONSpreflight. Adding a header adds a network round trip to every load. - Only the
GET,HEADandPOST(for the view signal) methods. - The rate-limit headers (
x-ratelimit-*) are not readable from JavaScript on cross-origin calls; only the429status code is.
Caching
Successful responses of the three GET paths have:
Cache-Control: public, s-maxage=60, max-age=0, must-revalidate
- The CDN keeps one copy per URL for at most 60 seconds. When staff save a change, the system actively purges the affected URLs from the CDN, so changes usually show up right away; 60 seconds is the maximum delay when the purge does not get through.
- The browser does not reuse an old copy; it always asks again (the CDN answers quickly).
- Error responses (
4xx,5xx) always haveCache-Control: private, no-storeand are never stored.
The active purge only knows one way of writing a URL. For your site to pick up changes right away:
- Write the parameters in exactly the order
locale, category, tag, q, sort, page, limit, with no other parameters. - Always set
localeexplicitly, including for/site. - For lists, only page 1 is actively purged; later pages, and every search URL (
q), may lag by up to 60 seconds.
Keeping a single way of writing URLs also lets all readers share one copy in the CDN.
Rate limits
Limits are counted per caller address:
| Path | Limit |
|---|---|
GET /site, GET /entries, GET /entries/{entrySlug} | 20 requests / 10 seconds, 50 requests / 10 seconds (shared), 120 requests / 60 seconds |
POST /entries/{entrySlug}/view | 5 requests / 10 seconds, 30 requests / 60 seconds |
Exceeding a limit returns 429 with errorCode: "RATE_LIMITED". Every response has the headers x-ratelimit-limit-*, x-ratelimit-remaining-*, x-ratelimit-reset-* (seconds) for the short, medium and long tiers.
For readers calling from the browser, each person has their own limit, so it is rarely reached. The real risk is your server: when you build a static site, render on the server or run a proxy, every request comes from one address.
- When building a static site: call sequentially, about 1 request per second (under 120 requests/minute), use
limit=100to reduce the number of pages, and retry after a few seconds when you hit429. - When rendering on the server per visit: put your own cache (for example 60 seconds) in front of the API. Do not turn every visit directly into an API request.
async function getWithRetry(url: string, tries = 4): Promise<Response> {
for (let i = 0; ; i++) {
const res = await fetch(url, { credentials: 'omit' })
if (res.status !== 429 || i === tries - 1) return res
await new Promise((r) => setTimeout(r, 2000 * 2 ** i)) // 2 s, 4 s, 8 s
}
}
Handling errors
The error body shape and the code table: API reference, Error shape. Checklist:
-
404on an entry → your "Not found" page (with SSR, return a real404status). For a secondary language, consider retrying in the primary language (see). -
404on/site→ wrong site code, site disabled, or language not enabled. This is a configuration error; do not show it to readers as a blank page: use fallback content and log it. -
info: null→ staff have not entered the details yet; use the fallback name and address you prepared. -
400→ a bug in your code (wrong parameter,limitnot in the list). Do not retry. -
429,5xx, network errors → retry with backoff; while waiting, keep the current content on screen or show a "Could not load, try again" box. - Empty list (
data: []) → show "No posts yet", especially for "Most read" on a new site. - Fields that may be missing →
cover,excerpt, keys inmeta, strings ininfo. - Validate the data you receive before using it (the type of each field), and filter
bodyHtmlagain before inserting it into the page. - The view signal must never break the page: ignore every error.
Recommended architecture
| Approach | Good for | Notes |
|---|---|---|
| Call from the browser (SPA) | Small sites, small teams | Simplest; CORS is already open. Content appears after JavaScript runs, which is worse for SEO. |
| Static site (SSG) + browser calls for the dynamic parts | Most parish websites | Pre-build the page shell, menus, contact details and existing posts; load the latest list, search and "Most read" from the browser. Rebuild periodically (for example every hour) so new posts get static pages. Keep a browser-side fallback for slugs that did not exist at build time. |
| Server-side rendering (SSR) with a cache | Large sites that need good SEO for every post | Put your own 60-second cache in front, respect the rate limits, and return real 404/301 for missing/old slugs. |
Whichever you choose:
- Put the API base URL and the site code in configuration variables, not hard-coded in scattered places.
- Route every
fetchto the API through one function (correctcredentials, no headers, correct parameter order). - Send the view signal only from the browser, never at build time.