glimr/cache/file_cache

File Cache Entry Point

This is the mirror of glimr_redis/redis.gleam but for the file backend. Application code calls file.start(“default”) and gets back a CachePool without needing to know about config loading, pool construction, or the file cache internals. One line in your main module and you’re caching.

Values

pub fn session_store(name: String) -> store.SessionStore

For apps that don’t need Redis, file-based sessions keep things simple — session data lives as files on disk, same as the cache. Pass the result to session.setup() in your bootstrap and you’ve got sessions with zero extra infrastructure.

pub fn start(name: String) -> cache.CachePool

Loads the cache config, finds the named file store, and returns a ready-to-use CachePool. Panicking on bad config is intentional — a missing cache directory at boot is better caught immediately than discovered when the first request tries to write a file and gets a confusing filesystem error.

Search Document