Skip to content

LachlanArthur/Psr16WordPressTransients

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 null or false. This is because the WP transient API returns false for a cache miss, and the PSR-16 spec must return null for a cache miss.

  • Key length is restricted to 172 characters, including the prefix.

About

Use the WordPress transient API as a PSR-16 cache

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages