GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - php-cache/prefixed-cache: [READ-ONLY] Prefixed PSR-6 Cache

BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
Exception
Exception
 
 
Tests
Tests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Changelog.md
Changelog.md
 
 
LICENSE
LICENSE
 
 
PrefixedCacheItem.php
PrefixedCacheItem.php
 
 
PrefixedCachePool.php
PrefixedCachePool.php
 
 
PrefixedSimpleCache.php
PrefixedSimpleCache.php
 
 
PrefixedUtilityTrait.php
PrefixedUtilityTrait.php
 
 
README.md
README.md
 
 
TaggablePrefixedCacheItem.php
TaggablePrefixedCacheItem.php
 
 
TaggablePrefixedCachePool.php
TaggablePrefixedCachePool.php
 
 
composer.json
composer.json
 
 
phpunit.xml.dist
phpunit.xml.dist
 
 

Repository files navigation

Prefixed cache decorators

Latest Stable Version Coverage Software License

This package adds a fixed prefix to keys sent to an existing PSR-6 or PSR-16 cache.

Unlike NamespacedCachePool, clearing a prefixed cache clears the entire underlying pool. Use the namespaced package when you need isolated clearing.

Installation

composer require cache/prefixed-cache:^2.0

Usage

use Cache\Adapter\PHPArray\ArrayCachePool;
use Cache\Prefixed\PrefixedCachePool;

$sharedPool = new ArrayCachePool();
$pool = PrefixedCachePool::create($sharedPool, 'billing.');

create() returns a taggable decorator when the wrapped PSR-6 pool supports native tags. Its cache items keep setTags(), and tag invalidation uses the wrapped pool.

The public constructor remains available. It always returns the basic PrefixedCachePool type, so use create() when you need tag support.

Use PrefixedSimpleCache to decorate a PSR-16 cache.

Prefixes are encoded before they are joined to public keys. The reversible _xHH_ format leaves ASCII letters, digits, _, and . unchanged. Every other byte is encoded, including each byte in non-ASCII text. A literal lowercase _x sequence is also encoded so it cannot look like an encoded byte.

Before upgrading to version 2 or rolling back from it, clear affected caches when a prefix contains bytes outside [A-Za-z0-9_.] or a lowercase _x sequence. Those prefixes use different storage keys in version 2.

Contributing

Send pull requests to the main repository. Report issues on the GitHub issue tracker.

About

[READ-ONLY] Prefixed PSR-6 Cache

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.