lachlanarthur / psr16-wordpress-transients
Use WordPress transients as a PSR-16 cache.
Package info
github.com/LachlanArthur/Psr16WordPressTransients
pkg:composer/lachlanarthur/psr16-wordpress-transients
1.1
2020-03-08 05:45 UTC
Requires
- psr/simple-cache: ^1.0
This package is auto-updated.
Last update: 2026-03-08 19:18:50 UTC
README
Use the WordPress transient API as a PSR-16 cache
composer require lachlanarthur/psr16-wordpress-transients
use LachlanArthur\Psr16WordPressTransients\WordPressTransientAdapter new WordPressTransientAdapter( 'prefix-', MONTH_IN_SECONDS );
NOTES
-
This cache cannot store
nullorfalse. This is because the WP transient API returnsfalsefor a cache miss, and the PSR-16 spec must returnnullfor a cache miss. -
Key length is restricted to 172 characters, including the prefix.