gino icon indicating copy to clipboard operation
gino copied to clipboard

Support for Redis caching of query response

Open robd003 opened this issue 5 years ago • 2 comments

I was wondering if there was a suggested way to cache a query response from GINO using redis. It would be great to have redis support built in so that repeated calls from clients getting the exact same results would hit the cache rather than cause a thundering herd to the DB.

robd003 avatar Sep 24 '20 03:09 robd003

I'm not sure the caching feature has its place in GINO since it's not really related to the db interaction. You could try using async-caches, I use it in my own framework for this exact purpose and it works great.

gazorby avatar Sep 24 '20 07:09 gazorby

@gazorby thanks for the suggestion! You're right, Redis caching would be probably not included in GINO.

However, I'm thinking it might be a handy design to build a slot in baked query API to plug-in caching support. It doesn't look easy now, but I do want to add this slot in 1.4/2.0. So please keep this issue open, thanks for proposing!

fantix avatar Sep 25 '20 03:09 fantix