I was wondering whether there are any officially recommended patterns for caching hasura responses to a redis instance.
Couldn't find any documentation/open issues/blog posts talking about this, here's what I have in mind:
Crazy feature idea for hasura: Let users set redis/cluster endpoints within hasura and allow users to specify caching behavior for given tables/relationships/queries => Boom. Automatic caching 馃く
Just wondering if there is any guidance for caching for Hasura? In my particular use case, I have a remote schema that runs business logic on an Apollo GQL server running on serverless. Ideally I鈥檇 like Hasura to check Redis for the cached version and if there鈥檚 a hit, skip the call to the remote schema and return the Redis data.
At the moment, what I am planning to do is have Redis with Apollo (maybe I鈥檒l use Apollo鈥檚 inbuilt caching- will test it out) so the serverless function will have to execute but should only run for a fraction of the time it would otherwise as a cache hit will be the result 99% of the time.
As @AdityaAnand1 says above, it would be great to have Hasura manage the caching with Redis or some other method.
Any thoughts on whether this could be picked up soon?
@rikinsk @shahidhk @rakeshkky
A managed caching system on top of hasura would be a total killer! I see custom invalidation rules with built in triggers
Unfortunately that this feature is available only on Hasura Cloud. :/ Hope that open source version still able to attach caching middleware or gateway.
https://hasura.io/docs/1.0/graphql/cloud/response-caching.html
@jukbot According to https://hasura.io/docs/1.0/graphql/cloud/response-caching.html there's a few gotchas there, namely
I use both points heavily so I am not sure I'll get any benefit out of Hasura Clouds caching vs the free version. I hope over time these are supported as I would probably head to Hasura Cloud if so (but ideally they are in the open source version too).
Most helpful comment
Crazy feature idea for hasura: Let users set redis/cluster endpoints within hasura and allow users to specify caching behavior for given tables/relationships/queries => Boom. Automatic caching 馃く