Ttl Keyed JSON Cache Lenient Decode

A small keyed cache for values that drift — each entry carries the moment it was fetched and answers an isStale check against a time-to-live constant, the whole map is stored as one JSON string in key-value preferences, and decoding is lenient plus wrapped so a schema change degrades to a cache miss instead of destroying every entry. Use when caching resolved covers, lookups or per-key results without a database table, or when a cache stopped working entirely after a model field was added.

maxrave-dev ef3b369 6.4 KB Updated

File contents

maxrave-dev/kotlin-footguns/tree/main/skills/ttl-keyed-json-cache-lenient-decode commit ef3b369b4a

Frequently asked questions

npx skillmds@latest add maxrave-dev/ttl-keyed-json-cache-lenient-decode