Add ability to set cache via query header.

This commit is contained in:
2023-11-14 09:52:51 +00:00
parent 93318df9fe
commit 9c9fa94140
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -134,6 +134,8 @@ You can then start using the cache by setting the `ENABLE_GLOBAL_CACHE` environm
In the case of the `@cached` you can add additional parameters to the directive which will set the cache for specific queries to the provided time.
For example, `query MyCachedQuery @cached(ttl: 90) ....` will set the cache for the query to 90 seconds.
You can also set cache for specific query by using `X-Cache-Graphql-Query` header, which will set the cache for the query to the provided time, for example `X-Cache-Graphql-Query: 90` will set the cache for the query to 90 seconds.
Since version `0.5.30` the cache is gzipped in the memory, which should optimise the memory usage quite significantly.
### Security