Caching layer for sitemap generation.
Manages ETS cache for entries, per-module XML, and index XML. When invalidated, clears ETS cache and deletes sitemap files.
Cache Key Scheme
:index_xml- The sitemapindex XML content{:module_xml, "sitemap-shop"}- Per-module XML content{:module_entries, :shop}- Per-module collected entries:entries- All collected entries (legacy):parts- Sitemap index parts (legacy)
Summary
Functions
Deletes a specific cache entry.
Retrieves a cached value by key.
Gets cached XML content for a specific module.
Checks if a cached value exists for the given key.
Initializes the ETS cache table.
Clears all cached data and deletes all sitemap files.
Alias for invalidate/0.
Invalidates all cache keys for a specific source module.
Stores a value in cache with the given key.
Caches XML content for a specific module.
Returns cache statistics.
Functions
@spec delete(term()) :: :ok
Deletes a specific cache entry.
Retrieves a cached value by key.
Gets cached XML content for a specific module.
Checks if a cached value exists for the given key.
@spec init() :: :ok
Initializes the ETS cache table.
Safe to call multiple times - returns :ok if table already exists.
@spec invalidate() :: :ok
Clears all cached data and deletes all sitemap files.
Should be called when sitemap content changes.
@spec invalidate_all() :: :ok
Alias for invalidate/0.
@spec invalidate_module(String.t()) :: :ok
Invalidates all cache keys for a specific source module.
Stores a value in cache with the given key.
Caches XML content for a specific module.
@spec stats() :: map()
Returns cache statistics.