idealley / feathers-hooks-rediscache

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

feat: immediateCacheKey #60

Closed SassNinja closed 5 years ago

SassNinja commented 5 years ago

Summary

(If you have not already please refer to the contributing guideline as described here)

If so, please mention them to keep the conversations linked together.

Other Information

This PR adds the new option immediateCacheKey to the before hook. If true the cache key will be determined in the before hook (instead of the after hook) and stored in params.cacheKey to be available in the after hook.

The use case for this feature is if you do a lot of query manipulation. With this option you're able to keep the cache key size as small as possible. I've updated the README accordingly and added tests.

@idealley would you please review and let me know what you think?

Closes https://github.com/idealley/feathers-hooks-rediscache/issues/59

codecov[bot] commented 5 years ago

Codecov Report

Merging #60 into master will increase coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   96.85%   96.89%   +0.04%     
==========================================
  Files           6        6              
  Lines         127      129       +2     
==========================================
+ Hits          123      125       +2     
  Misses          4        4
Impacted Files Coverage Δ
src/hooks/redis.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b0dc8de...27e550c. Read the comment docs.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.2%) to 92.891% when pulling 27e550cd68a82c1f55eafb574876474e028c0a6b on SassNinja:feature/custom-cache-key into b0dc8de5d537e8cea390bed115bf2d126183eb1d on idealley:master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.2%) to 92.891% when pulling 27e550cd68a82c1f55eafb574876474e028c0a6b on SassNinja:feature/custom-cache-key into b0dc8de5d537e8cea390bed115bf2d126183eb1d on idealley:master.

idealley commented 5 years ago

I will review it this weekend. Thank you! (I need to finish my hand over)