rfink / sequelize-redis-cache

Small fluent interface for caching sequelize database query results in redis more easily
MIT License
175 stars 47 forks source link

Update cache on sequelize update data for key. #24

Closed devdavidkarlsson closed 8 years ago

devdavidkarlsson commented 8 years ago

I am missing the update functionality:

When a object is created/updated I want it to be cached immediately. Not only on search/find..

rfink commented 8 years ago

Hello and thanks for checking out my module. I have considered this idea in the past, and decided that in order to add a fully transactional cache model, the module would need to be completely overhauled and integrated as a plugin to sequelize. Also, one complication here is the issue of aggregate queries that touch created/updated items. It would be extremely complex to coordinate busting aggregate cache keys. If anyone had an idea on a simple way to do this, I would be open to accepting a pull request.