class

Vug::CacheCoordinator

Inherits Reference < Object

Constructors

new(config : Config, memory_cache : MemoryCache | Nil = nil, cache_manager : CacheManager | Nil = nil)
Source

Instance methods

fetch(url : String) : String | Nil

Retrieves a cached path for the given URL.

Lookup order:

  1. CacheManager (config-backed on_load + its own memory cache)
  2. Coordinator's memory cache (fallback if CacheManager has none)
Source
store(url : String, path : String) : Nil

Stores a fetched result in both the memory cache and config-backed cache manager.

Note: Neither layer invokes the on_save config callback through this path. The on_save callback is called by ImageProcessor::Default#process_bytes before this method is reached. This avoids double-persisting the same data. See CacheManager#set for details on the write-path asymmetry.

Source