idealley / feathers-hooks-rediscache

Set of caching hooks and routes for feathersjs.
MIT License
38 stars 12 forks source link

Limit keys per endpoint, add purge hook #73

Open sarkistlt opened 5 years ago

sarkistlt commented 5 years ago

First thank you for library really helpful!! Just a couple suggestion to improve:

idealley commented 5 years ago

For the first point, you can easily call the the invalidation route with the required params, and it could be done in a hook.

But indeed we could do a generic hook for that I will try to make the time.

The second point is a good idea, just a question do you have storage issues with redis? Routes will be automatically deleted when they expire.

sarkistlt commented 5 years ago

for the second one I don’t have any problems with the storage but it’s still useful to have control on the quantity of the keys per endpoint. Just an example, any eCom. site, user will login and shop for ~15m, and we have 500k users in db and ~100 real time users at a time. Of corse we don’t want to use cache in this case as it is because it will blow redis, but if we can limit it let’s say by 500 entries then it will solve this problem and will increase querying speed for online users