PHPackages                             hypernic/filecache - 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. hypernic/filecache

ActiveLibrary[Caching](/categories/caching)

hypernic/filecache
==================

Hypernic FileCache is a lightweight file-based caching library for PHP 8+

v1.0.2(8mo ago)061MITPHPPHP &gt;=8.0

Since Sep 11Pushed 8mo agoCompare

[ Source](https://github.com/hypernic/filecache)[ Packagist](https://packagist.org/packages/hypernic/filecache)[ Docs](https://github.com/hypernic/filecache)[ RSS](/packages/hypernic-filecache/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (1)

Hypernic FileCache
==================

[](#hypernic-filecache)

FileCache is a lightweight **file-based caching library** for **PHP 8+**. It is designed to be fast, cross-platform, and safe with features such as default cache root in `sys_get_temp_dir()`, sharded directory structure based on `sha1(key)`, TTL handled via `filemtime()`, atomic writes (`LOCK_EX` + `rename()`), conditional compression (`gzencode/gzdecode`), optional APCu support for hot values (with filesystem fallback), and a simple API (`set`, `get`, `delete`, `flush`, `increment`, `decrement`, `replace`).

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

[](#installation)

Install with Composer:

```
composer require hypernic/filecache
```

Or copy `FileCache.php` directly into your project.

Usage Example
-------------

[](#usage-example)

```
