Hello OpenResty users,
In an attempt to standardize a common operation, throughout my code :
"looking up external data (memc, redis, ...), and then caching it in my application code".
I ended up writing a simple state machine that would ideally fit all my use cases.
it's aimed at being simple from a user perspective, by requiring only 1 external callback (external_lookup), and optionally callbacks to serialize / de-serialize data if you intend to cache more than strings.
it also aims at preventing external resource stampede (by using a lock, and negative cache), and maximize fault tolerance by using stale data if available.
Feedback welcome,
Matthieu.