We have several cases where need to store some data temporarily :
- Asynchronous Renditions is one case
- Conversions is one case
- Asynchonous S3 BinaryManager
We may also want to have this kind of storage to handles some flags on documents :
- this document is being re-indexed
- this document is being moved
This transient storage is different from a simple case because we don't want do have the "cache entries" removed too early.
- I should not remove the S3 cache entry before the actual S3 upload is completed
- I should not delete the rendition before someone reads it (or at least I should wait a few hours)
The idea is to base the implementation on a 2 levels cache system :
- L1 cache is long lived
- L2 cache is short lived
Entries are initially stored on L1 and moved in L2 when they have been used .