Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
GraphQL Core 0.0.4
-
None
Description
We've discussed on our dev list how to provide caching support and we'd like to leverage front-end HTTP caches that people usually use in front of Sling.
The suggested* interaction scenario* is:
- 1) GraphQL queries executed via POST are not cached by Sling
- 2) Queries can be prepared in advance by POSTing the query text to
Sling, which returns a "201 created" status with a URL that contains
the query's digest, like cf81d4
- 3) Clients run such prepared queries by making GET requests to URLs
like /graphqlservlet/prepared/cf81d4.json
- 4) The responses to such prepared queries requests contain HTTP
Cache headers which might (maybe in later phase) be set from hints supplied by data fetchers with configurable defaults. This allows these responses to be cached by the usual front-end HTTP caches, CDN etc.
- 5) There's no guarantee on how long the prepared queries are stored, a
client that gets a 404 on a prepared query request must be prepared to
use the default POST request method or store the prepared query again
Attachments
Issue Links
- relates to
-
SLING-9720 Present the persisted queries endpoints using the same extension the GraphQL servlet uses
- Closed
-
SLING-9744 Add metrics for the persisted queries
- Closed
- links to