SkillAgentSearch skills...

Phpfastcache

A high-performance backend cache system. It is intended for use in speeding up dynamic web applications by alleviating database load. Well implemented, it can drops the database load to almost nothing, yielding faster page load times for users, better resource utilization. It is simple yet powerful.

Install / Use

/learn @PHPSocialNetwork/Phpfastcache

README

Total Downloads Latest Stable Version PHPSTAN Cache Interface Extended Coding Style Simple Cache Code Climate Scrutinizer Code Quality Build status Semver compliant License Patreon

:warning: Please note that the V9 is mostly a PHP 8 type aware update of Phpfastcache with some significant changes !

As the V9 is relatively not compatible with previous versions, please read carefully the migration guide to ensure you the smoothest migration possible. One of the biggest changes is the configuration system which is now an object that replace the primitive array that we used to implement back then. Also, please note that the V9 requires at least PHP 8 or higher to works properly.


Simple Yet Powerful PHP Caching Class

More information in Wiki The simplicity of abstraction: One class for many backend cache. You don't need to rewrite your code many times again.

Supported drivers at this day *

:bulb: Feel free to propose a driver by making a new Pull Request, they are welcome !

| Regular drivers | High performances drivers | Development drivers (Core) | Cluster-Aggregated drivers (Core) | |--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|--------------------------------------------|---------------------------------------| | Apcu (Core) <br>(APC support removed) | Arangodb (Extension) | Devnull | FullReplicationCluster | | Dynamodb (Extension) | Cassandra <br> (PHP extension is no more maintained by Datastax, might be deprecated in v10) | Devrandom | SemiReplicationCluster | | Files (Core) | CouchBasev3 (Core)<br>(Will be deprecated as of v10) | Memory<br>(Previously named Memstatic) | MasterSlaveReplicationCluster | | Firestore (Extension) | CouchBasev4 (Extension) | | RandomReplicationCluster | | Leveldb (Core) | Couchdb (Extension) | | | | Memcache(d) (Core) | Mongodb (Extension) | | | | Solr (Extension) | Predis (Core) | | | | Sqlite (Core) | Ravendb _(Extension) | | | | Wincache (Core) <br>(Deprecated as of v9.2, will be removed as of v10) | Relay (By end of 2024) | | Zend Disk Cache (Core) | Redis/RedisCluster (Core) | | | | | Ssdb (Core) | | | | | Zend Memory Cache (Core) | | |

* Driver descriptions available in DOCS/DRIVERS.md

:new: As of v9.2 a new Couchbase extension has been released: Couchbasev4 Also a new driver extension has been added: Ravendb. The driver will be actively developed in the feature to allow better fine-grained configuration. This new extension is the beginning of a new era for Phpfastcache along with some others:
Many drivers has been moved from the core to their own sub-repository as a standalone extension: Arangodb, Couchdb, Dynamodb, Firestore, Mongodb, Solr.
They can be easily added through composer, ex: composer install phpfastcache/couchbasev4-extension However Couchbasev3 will stay in the core for compatibility reasons but will be deprecated.


Because caching does not mean weaken your code

Phpfastcache has been developed over the years with 3 main goals:

  • Performance: We optimized and still optimize the code to provide you the lightest library as possible
  • Security: Because caching strategies can sometimes comes with unwanted vulnerabilities, we do our best to provide you a sage & strong library as possible
  • Portability: No matter what operating system you're working on, we did our best to provide you the most cross-platform code as possible

Rich Development API

Phpfastcache provides you a lot of useful APIs:

Item API (ExtendedCacheItemInterface)

| Method | Return | Description | |-------------------------------------------------|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| | addTag($tagName) | ExtendedCacheItemInterface | Adds a tag | | addTags(array $tagNames) | ExtendedCacheItemInterface | Adds multiple tags | | append($data) | ExtendedCacheItemInterface | Appends data to a string or an array (push) | | decrement($step = 1) | ExtendedCacheItemInterface | Redundant joke... | | expiresAfter($ttl) | ExtendedCacheItemInterface | Allows you to extends the lifetime of an entry without altering its value (formerly known as touch()) | | expiresAt($expiration) | ExtendedCacheItemInterface | Sets the expiration time for this cache item (as a DateTimeInterface object) | | get() | mixed | Th

Related Skills

View on GitHub
GitHub Stars2.4k
CategoryData
Updated17d ago
Forks450

Languages

PHP

Security Score

100/100

Audited on Mar 7, 2026

No findings