Ghost/ghost/api-framework/lib
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
..
serializers Removed bluebird from api-framework module (#15685) 2022-10-31 19:30:18 +00:00
utils Extracted shared API framework to separate package 2022-08-11 17:44:59 +02:00
validators Removed bluebird from api-framework module (#15685) 2022-10-31 19:30:18 +00:00
api-framework.js Added eslint rule for file naming convention 2023-05-09 12:34:34 -04:00
Frame.js Added eslint rule for file naming convention 2023-05-09 12:34:34 -04:00
headers.js Implemented duplicate post functionality (#16767) 2023-05-15 09:30:32 +01:00
http.js Added function names to all Express middleware 2023-08-30 11:47:50 +02:00
pipeline.js Implemented Refresh-Ahead caching for Redis 2024-01-18 20:16:36 +07:00