mxHeadless
REST API gateway for headless frontends on MODX 3. Resources, objects, OpenAPI, API keys, and OAuth

Public GET responses can be cached in the browser or CDN when mxheadless_cache_enabled=true.
On safe routes for anonymous callers:
Cache-Control: public, max-age=300
ETag: "a1b2c3d4e5f6..."max-age comes from mxheadless_cache_ttl (default 300 seconds).
Send the ETag from a previous response:
curl -s -D - https://example.com/api/v1/resources/5 \
-H 'If-None-Match: "a1b2c3d4e5f6..."'When the representation is unchanged, the server returns 304 Not Modified with no body.
Access-Control-Expose-Headers includes ETag so browser fetch can revalidate. See CORS.
Responses with a session, API key, or ?preview=true:
Cache-Control: private, no-storeDo not put them on a shared CDN.
Saving or deleting a resource clears object and list cache tags. For a headless frontend, use webhooks and ISR revalidation.