Skip to content
/ cache Public

A fiber-aware cache API based on Amp and Revolt.

License

Notifications You must be signed in to change notification settings

amphp/cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e6d0bf9 · Jan 26, 2025
Apr 19, 2024
Jan 26, 2025
Jan 9, 2023
Jun 16, 2017
Mar 31, 2018
Dec 11, 2021
Feb 3, 2022
Jul 27, 2015
Jan 9, 2023
Sep 12, 2022
Dec 11, 2021
Jan 26, 2025
Dec 11, 2021
Oct 28, 2022

Repository files navigation

amphp/cache

AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind. amphp/cache specifically provides a cache interface and multiple implementations of it.

Latest Release MIT License

Installation

This package can be installed as a Composer dependency.

composer require amphp/cache

Usage

AtomicCache

Cache

<?php

namespace Amp\Cache;

interface Cache
{
    public function get(string $key): mixed;

    public function set(string $key, mixed $value, int $ttl = null): void;

    public function delete(string $key): ?bool;
}

LocalCache

NullCache

Cache implementation that just ignores all operations and always resolves to null.

PrefixCache

SerializedCache

StringCache

StringCacheAdapter