Preserve Cache
When enabled, the preserve cache stores IDs of preserved messages so repeated runs can keep seeing items that would otherwise fall outside the fetched slice.
This matters most when you combine a limited fetch window with retention rules that need continuity across runs.
To understand the related flags first, see:
What is stored
- IDs of deletable messages preserved by
--preserve-nor--preserve-last - if
--delete-reactionsis enabled, IDs of preserved messages that still contain your reactions
In practice, that means the cache is about preserved items, not all fetched messages.
Why it exists
It is especially useful when:
- you use
--preserve-n - you use a limited
--fetch-max-age - you run the tool repeatedly as part of a rolling retention workflow
Without the cache, repeated runs with a limited fetch window can stop “seeing” items that still matter to the preserve rules.
How the preserve flags work together
--preserve-lastkeeps messages inside a recent time window.--preserve-nkeeps the last N messages in each channel.--preserve-n-modedecides how that N is counted.--fetch-max-agelimits the fetched slice.--preserve-cachehelps repeated runs preserve continuity when the fetched slice is limited.
If you only use --preserve-last and fetch a wide enough recent window every time, preserve-cache is often unnecessary. It becomes much more important once --preserve-n and limited fetch windows enter the picture.
Dry-run behavior
--dry-run uses a separate preserve cache path by appending .dryrun.json to the active cache file.