Documentation

Learn the cache, then decide when it should evict.

SwiftStash has a narrow API. The guide covers installation, memory caches, disk persistence, and the eviction methods that change cache state.

Getting started

Check requirements, add the package, create a cache, and make the first read.

Memory storage

Use MemoryStorageEngine when values should last only as long as the cache actor.

Disk storage

Persist Codable data with JSON or bring your own DiskStorageSerializer.

Eviction

Compare FIFO, LIFO, and LRU, then call eviction at the point your app chooses.

Examples

Copy from independent executable Swift packages in the repository.

API reference

Generated documentation for public cache, storage, serializer, and key types.

Open API reference