PHPackages                             sokil/php-2q - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. sokil/php-2q

ActiveLibrary[Caching](/categories/caching)

sokil/php-2q
============

2Q cache implementation

0.0.1(3y ago)19MITPHPPHP ^8.1

Since Mar 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/sokil/php-2q)[ Packagist](https://packagist.org/packages/sokil/php-2q)[ RSS](/packages/sokil-php-2q/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

2Q Cache Full Version
=====================

[](#2q-cache-full-version)

[![Coverage Status](https://camo.githubusercontent.com/601c0da2b31ecd9bb00844720d8a6e914e882386486bf482acb65547090f4552/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736f6b696c2f7068702d32712f62616467652e7376673f6272616e63683d6d61696e26763d31)](https://coveralls.io/github/sokil/php-2q?branch=main)

The Q2 cache algorithm is a caching algorithm that aims to balance between frequently accessed and infrequently accessed items in a cache. It works by dividing the cache into three buffers: a frequently accessed buffer (in), a moderately accessed buffer (out), and an infrequently accessed buffer (main). The "in" is the smallest buffer and contains the most frequently accessed items. The "out" buffer is larger and contains items that are accessed less frequently than those in the "in" but more frequently than those in the "main". The "main" is the largest buffer and contains items that are rarely accessed.

See full description in

Installation
------------

[](#installation)

```
composer req sokil/php-2q

```

Usage
-----

[](#usage)

```
