A simple transparent caching wrapper for Node. Wrap a function with it and call it normal. And the cache stays warm with background updates, so it’s always fast.
Available on GitHub
Previously I covered a more sophisticated caching solution for Firestore. However, you don’t always need something that complex.
Sometimes you just want an expensive function call to be cached for 5 or 10 minutes to reduce load. This is often the case for read-focused operations where it’s ok if the results are a little stale. Especially things like search results, image caching, certain computationally expensive operations, etc.
For that purpose, I built this transparent caching wrapper.
#programming #typescript #redis #development #nodejs