composer require lachlanarthur/psr16-wordpress-transients
use LachlanArthur\Psr16WordPressTransients\WordPressTransientAdapter
new WordPressTransientAdapter( 'prefix-', MONTH_IN_SECONDS );
-
This cache cannot store
null
orfalse
. This is because the WP transient API returnsfalse
for a cache miss, and the PSR-16 spec must returnnull
for a cache miss. -
Key length is restricted to 172 characters, including the prefix.