[ 
https://issues.apache.org/jira/browse/SLING-9655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17175635#comment-17175635
 ] 

Bertrand Delacretaz commented on SLING-9655:
--------------------------------------------

The Docker image at 
[https://github.com/apache/sling-whiteboard/tree/master/http-caching-experiments]
 can be used to test how {{mod_cache}} handles HTTP caching headers.

Responses contain {{X-Cache-*}} headers which help understand the caching 
behaviour, like

{code}
HTTP/1.1 200 OK
Date: Tue, 11 Aug 2020 15:08:12 GMT
Server: Apache/2.4.46 (Unix)
Cache-Control: max-age=5
Age: 2
X-Cache: HIT from 172.17.0.2
X-Cache-Detail: "cache hit" from 172.17.0.2
Content-Length: 38
Content-Type: text/plain

max-age=5 at Tue Aug 11 15:08:10 2020
{code}

> Caching support for the GraphQL core
> ------------------------------------
>
>                 Key: SLING-9655
>                 URL: https://issues.apache.org/jira/browse/SLING-9655
>             Project: Sling
>          Issue Type: Task
>          Components: GraphQL
>    Affects Versions: GraphQL Core 0.0.4
>            Reporter: Bertrand Delacretaz
>            Assignee: Radu Cotescu
>            Priority: Major
>
> We've discussed [on our dev 
> list|https://lists.apache.org/thread.html/r00652fa5bc54f96bb3ec01264905d9a1f36677a71070fa1b724570f9%40%3Cdev.sling.apache.org%3E]
>  how to provide caching support and we'd like to leverage front-end HTTP 
> caches that people usually use in front of Sling.
> What we've discussed 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.
> * 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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to