tc-cache
Requirement
You have to get a redis bdd running somewhere, as this package will connect to it.
You can set cache expiration with the environment variable KL_CACHE_DURATION
, which take a duration in seconds.
Example
Instead of this :
router.get'', ;
Do this :
; router.get'', ;
That's it.
This require to decompose req
in your service instead of your route... but let's just say i'm sorry for this.
Latter functionnalities
Random hash on startup
Side infos
tc-cache also use pino as a logger. You can set it's level by adding an environment variable called LEVEL
.