Ghost/ghost/adapter-cache-redis/test
Fabien "egg" O'Carroll f34999a51f Implemented Refresh-Ahead caching for Redis
This updates the AdapterCacheRedis instance to be able to handle updating
itself when reading from the cache. For this to work we need to pass a
`fetchData` function to the `get` method.

In the case of a cache miss, we will read the data via the `fetchData`
function, and store it in the cache, before returning the value to the caller.

When coupled with a `refreshAheadFactor` config, we will go a step further and
implement the "Refresh Ahead" caching strategy. What this means is that we will
refresh the contents of the cache in the background, this happens on a cache
read and only once the data in the cache has only a certain percentage of the
TTL left, which is set as a decimal value between 0 and 1.

e.g.

ttl = 100s
refreshAheadFactor = 0.2;

Any read from the cache that happens _after_ 80s will do a background refresh
2024-01-18 20:16:36 +07:00
..
.eslintrc.js
adapter-cache-redis.test.js Implemented Refresh-Ahead caching for Redis 2024-01-18 20:16:36 +07:00
redis-store-factory.test.js Added option to share redis connections across caches 2023-09-07 13:32:00 +08:00