Tereta/Cache Module

Overview

Caching module. Stores data in a file-based cache in the var/cache/ directory with TTL (time-to-live) support.

CLI Commands

./cli.php cache:status    # Cache status (size, expiration, driver)
./cli.php cache:clear     # Clear all cache

Usage

use Tereta\Cache\Services\Cache;

// Store a value (default TTL is 1 hour)
Cache::singleton()->set('key', 'value', 3600);

// Retrieve a value (null if expired or not found)
Cache::singleton()->get('key');

// Delete a specific entry
Cache::singleton()->delete('key');

// Clear all cache
Cache::singleton()->clear();

Author and License

Author: Tereta Alexander
Website: tereta.dev
License: Apache License 2.0. See LICENSE.

 www.████████╗███████╗██████╗ ███████╗████████╗ █████╗
     ╚══██╔══╝██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗
        ██║   █████╗  ██████╔╝█████╗     ██║   ███████║
        ██║   ██╔══╝  ██╔══██╗██╔══╝     ██║   ██╔══██║
        ██║   ███████╗██║  ██║███████╗   ██║   ██║  ██║
        ╚═╝   ╚══════╝╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝
                                                      .dev

Copyright (c) 2024-2026 Tereta Alexander