Expand description
Global cache configuration
Provides a simple way to enable/disable all caching globally.
Caching is disabled by default and must be explicitly enabled
via set_caching_enabled(true) or the TYPF_CACHE=1 environment variable.
§Example
use typf_core::cache_config;
// Enable caching (disabled by default)
cache_config::set_caching_enabled(true);
// Check if caching is enabled
if cache_config::is_caching_enabled() {
println!("Caching is ON");
}
// Disable caching again
cache_config::set_caching_enabled(false);§Environment Variable
Set TYPF_CACHE=1 to enable caching at startup:
TYPF_CACHE=1 ./my_appStructs§
Functions§
- clear_
all_ caches - Clear all caches (convenience function)
- is_
caching_ enabled - Check if caching is globally enabled
- scoped_
caching_ enabled - Scoped override for the global caching flag.
- set_
caching_ enabled - Enable or disable caching globally at runtime