You’re reading the v0.1 development preview. APIs may change.
~ 1 min readUpdated 2026-10-29

Cache

The container binds PSR-16 CacheInterface to a filesystem-backed Symfony cache. Inject the interface rather than a concrete implementation.

Store and retrieve

use Psr\SimpleCache\CacheInterface;

$cache->set('homepage.summary', ['posts' => 12], 300);
$summary = $cache->get('homepage.summary', []);
$cache->delete('homepage.summary');

TTL values are seconds, DateInterval objects, or null. Use application-controlled keys; PSR-16 reserves some characters.

In a handler

$router->get('/summary', function (CacheInterface $cache) {
    return $cache->get('homepage.summary', ['posts' => 0]);
});

Clear application cache

php elang cache:clear

The command clears the application cache pool. Twig's compiled templates are separate and automatically reload when source files change. Multi-server applications should bind a suitable shared cache adapter.

Need a hand?

Check the troubleshooting guide, look up a term in the glossary, or work through the complete task board project.

Search Elang documentation

Start typing to find your next step.