HTTP Caching

📣 Note: This feature is unlocked by the Cache Control extension.

Because it sends the queries via POST, GraphQL is normally not cacheable on the server-side or intermediate stages between the client and the server (such as a CDN), and we need to worry about adding a caching layer on the application on the client-side, making it slower and more complex.

However, because persisted queries can be accessed via GET, their response can be cached through standard HTTP caching. We can define for how long every field or directive must be cached, and the response will include a Cache-Control header, whose max-age value is calculated automatically from all the fields and directives in the requested query (or no-store if it involves user state).

Cache Control List editor
Cache Control List editor