haive.core.engine.document.loaders.cache_manager¶
Cache manager for document loader registry.
This module provides caching functionality to speed up document loader initialization by avoiding repeated scanning of 230+ loader modules.
Classes¶
Manages caching of document loader registry data. |
Functions¶
Clear the document loader cache. |
|
Get the global cache manager instance. |
|
Get current cache status information. |
Module Contents¶
- class haive.core.engine.document.loaders.cache_manager.RegistryCacheManager(cache_dir=None, cache_ttl_days=7, use_memory_cache=True)[source]¶
Manages caching of document loader registry data.
This significantly speeds up imports by caching: - Discovered source modules - Registered loaders and their configurations - Source type mappings - Loader capabilities
Cache is invalidated when: - Source files are modified - Package version changes - Cache expires (default 7 days) - User explicitly clears cache
Initialize cache manager.
- Parameters:
cache_dir (pathlib.Path | None) – Directory for cache files (default: ~/.cache/haive/loaders)
cache_ttl_days (int) – Cache time-to-live in days
use_memory_cache (bool) – Whether to use in-memory caching for current session
- save_registry_cache(registry_data, source_files=None)[source]¶
Save registry data to cache.
- Parameters:
source_files (set[pathlib.Path] | None) – Set of source files that were scanned
- Returns:
True if cache was saved successfully
- Return type:
- haive.core.engine.document.loaders.cache_manager.clear_loader_cache()[source]¶
Clear the document loader cache.
Use this when you’ve installed new packages or made changes to loader implementations.
- Return type:
None