Search by

marko / cache-redis

markshust

Redis cache driver for Marko Framework

Package info

github.com/marko-php/marko-cache-redis

Type:marko-module

pkg:composer/marko/cache-redis

Statistics

Installs: 899

Dependents: 3

Suggesters: 1

Stars: 0

0.16.0 2026-11-30 21:39 UTC

README

Redis cache driver --- fast, persistent caching backed by Redis for production workloads.

Installation

composer require marko/cache-redis

Quick Example

use Marko\Cache\Contracts\CacheInterface;

class SessionStore
{
    public function __construct(
        private CacheInterface $cache,
    ) {}

    public function getSession(string $token): ?array
    {
        return $this->cache->get("session.$token");
    }

    public function saveSession(
        string $token,
        array $data,
    ): void {
        $this->cache->set("session.$token", $data, ttl: 1800);
    }
}

Documentation

Full usage, API reference, and examples: marko/cache-redis