PSR-6 cache implementation adapting a given PSR-16 instance

Overview

PSR-6 cache implementation adapting PSR-16

This package provides a PSR-6 cache instance when you only have a PSR-16 cache at hand. As PSR-6 is more feature-rich than PSR-16, this adaption is not utterly performant. And you should use it very carefully.

A suitable use-case might be that you already went with the leaner PSR-16 in your project but now want to add a third-party package that only supports PSR-6. It should be fine if that package uses the cache only at initialization, e.g. for schema caching. If, however, there is excessive or highly interactive caching traffic, you should consider refactoring your project towards PSR-6.

Usage

    $psr16 = new \Psr\SimpleCache\CacheInterface();
    $psr6  = new \Brnc\CachePsr16Adapter\CacheItemPool($psr16);

The constructor takes an optional second argument for a NowFactory to enable testing and mocking. Once PSR-20 (Clock) is accepted, the second argument and the NowFactory get refactored towards this interface!

You might also like...
:zap: Simple Cache Abstraction Layer for PHP

⚡ Simple Cache Class This is a simple Cache Abstraction Layer for PHP = 7.0 that provides a simple interaction with your cache-server. You can define

Doctrine Cache component

Doctrine Cache Cache component extracted from the Doctrine Common project. Documentation This library is deprecated and will no longer receive bug fix

More Than Just a Cache: Redis Data Structures
More Than Just a Cache: Redis Data Structures

More Than Just a Cache: Redis Data Structures Redis is a popular key-value store, commonly used as a cache or message broker service. However, it can

Simple cache

Simple cache

Elephant - a highly performant PHP Cache Driver for Kirby 3

🐘 Kirby3 PHP Cache-Driver Elephant - a highly performant PHP Cache Driver for Kirby 3 Commerical Usage Support open source! This plugin is free but i

An improved helper for working with cache

Laravel Cache Installation To get the latest version of Laravel Cache, simply require the project using Composer: $ composer require dragon-code/larav

Zend Framework cache backend for MongoDB

Zend_Cache_Backend_Mongo Author: Anton Stöckl About Zend_Cache_Backend_Mongo is a Zend Framework Cache Backend for MongoDB. It supports tags and autoc

PHP local cache

__ ____ _________ ______/ /_ ___ / __ \/ ___/ __ `/ ___/ __ \/ _ \ / /_/ / /__/ /_/ / /__/ / / / __/ / ._

Releases(v1.1.0)
  • v1.1.0(Oct 15, 2021)

    [1.1.0] - 2021-10-15 | Improve PSR-16 adaption & test coverage

    Changed

    • Change getItems to use getMultiple
    • Using NowFactory also for CacheItem

    Added

    • Increase test coverage (using PSR-16 exceptions)
    • Add tests to ensure PSR-6 commits make use of PSR-16's bulk setters

    A PSR-6 cache implementation adapting PSR-16.

    This package provides a PSR-6 cache instance when you only have a PSR-16 cache at hand. As PSR-6 is more feature-rich than PSR-16, this adaption is not utterly performant. And you should use it very carefully.

    Source code(tar.gz)
    Source code(zip)
Owner
null
Distributed PSR-16 cache implementation for PHP 6 that uses browser cookies to store data

cookiecache Cache beyond the edge with cookies! This library provides a distributed PSR-16 compatible cache implementation for PHP 6 that uses browser

Colin O'Dell 8 Apr 19, 2022
Simple cache abstraction layer implementing PSR-16

sabre/cache This repository is a simple abstraction layer for key-value caches. It implements PSR-16. If you need a super-simple way to support PSR-16

sabre.io 48 Sep 9, 2022
This is a Symfony bundle that lets you you integrate your PSR-6 compliant cache service with the framework

PSR-6 Cache bundle This is a Symfony bundle that lets you you integrate your PSR-6 compliant cache service with the framework. It lets you cache your

null 43 Oct 7, 2021
PSR-15 middleware with various cache utilities

middlewares/cache Middleware components with the following cache utilities: CachePrevention Expires Cache Requirements PHP >= 7.2 A PSR-7 http library

Middlewares 15 Oct 25, 2022
LRU Cache implementation in PHP

PHP LRU Cache implementation Intro WTF is a LRU Cache? LRU stands for Least Recently Used. It's a type of cache that usually has a fixed capacity and

Rogério Vicente 61 Jun 23, 2022
The cache component provides a Promise-based CacheInterface and an in-memory ArrayCache implementation of that

Cache Async, Promise-based cache interface for ReactPHP. The cache component provides a Promise-based CacheInterface and an in-memory ArrayCache imple

ReactPHP 330 Dec 6, 2022
PHP cache implementation supporting memcached

php cache implementation (PSR-6 and PSR-16) Support for memcached and APCu is included. Memcached $memcached = new Memcached(); $memcached->addServer(

Michael Bretterklieber 1 Aug 11, 2022
The place to keep your cache.

Stash - A PHP Caching Library Stash makes it easy to speed up your code by caching the results of expensive functions or code. Certain actions, like d

Tedious Developments 944 Jan 4, 2023
PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APC(u), SQL and additional capabilities (e.g. transactions, stampede protection) built on top.

Donate/Support: Documentation: https://www.scrapbook.cash - API reference: https://docs.scrapbook.cash Table of contents Installation & usage Adapters

Matthias Mullie 295 Nov 28, 2022
Cache slam defense using a semaphore to prevent dogpile effect.

metaphore PHP cache slam defense using a semaphore to prevent dogpile effect (aka clobbering updates, stampending herd or Slashdot effect). Problem: t

Przemek Sobstel 102 Sep 28, 2022