Download the PHP package utopia-php/cache without Composer
On this page you can find all versions of the php package utopia-php/cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cache
Utopia Cache
[!IMPORTANT] This repository is a read-only mirror of
packages/cachein appwrite/appwrite. Development happens there — please open issues and pull requests against appwrite/appwrite.
Utopia framework cache library is simple and lite library for managing application cache storing, loading and purging. This library is aiming to be as simple and easy to learn and use. This library is maintained by the Appwrite team.
Although this library is part of the Utopia Framework project it is dependency free and can be used as standalone with any other PHP project or framework.
Getting started
Install using Composer:
File System Adapter
Adapters
| Adapter | Notes |
|---|---|
Filesystem |
Files on disk, with optional streaming reads. |
Memory |
In-process array, useful in tests. |
None |
Stores nothing, for turning caching off. |
Redis |
phpredis, with reconnect and leases. |
Redis\Multiplexing |
Many Swoole coroutines over one Redis connection — see the multiplexing guide. |
RedisCluster |
phpredis against a Redis cluster. |
Memcached |
Memcached over the binary protocol. |
Hazelcast |
Hazelcast over its Memcached protocol. |
Sharding |
Spreads keys across several adapters. |
Pool |
Checks an adapter out of a utopia-php/pools pool per call. |
CircuitBreaker |
Wraps an adapter so a failing cache stops being called. |
Codecs
The Redis, Redis\Multiplexing, RedisCluster and Hazelcast adapters store each value through a Utopia\Cache\Codec. The default is Codec\Json, which writes the same JSON payloads as every earlier release, so existing caches keep working. Pass Codec\Igbinary for smaller, faster binary payloads that need the igbinary extension:
Adapters treat a payload they cannot decode as a miss, so switching the codec on a live cache re-populates it instead of failing. The Memcached adapter serializes through the extension's own OPT_SERIALIZER option, and Filesystem and Memory store values as given, so none of them take a codec.
System requirements
The library requires PHP 8.4 or later. The Redis, Memcached and Hazelcast adapters need the matching extension — see the suggest block in composer.json.
Tests
The unit tier needs nothing running:
The end-to-end tier runs on the host against this package's services:
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php
Benchmarks
The codec benchmark times each codec alone and through the Redis adapter. It needs the igbinary extension and starts Redis from the package's compose file when nothing is listening on the offset port:
All versions of cache with dependencies
ext-json Version *
utopia-php/circuit-breaker Version ^0.4
utopia-php/pools Version ^2.0
utopia-php/telemetry Version ^0.4