inanepain/cache

Some simple caching tools implementing PSR-6 and PSR-16.

Maintainers

Package info

github.com/inanepain/cache

pkg:composer/inanepain/cache

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

0.3.0 2026-06-08 18:45 UTC

This package is auto-updated.

Last update: 2026-06-08 18:49:39 UTC


README

Table of Contents

icon inanepain/cache

Some simple caching tools implementing PSR-6 and PSR-16.

1. Install

composer
composer require inanepain/cache

Some simple caching tools that implement PSR-6 and PSR-16.

2. Goals

There is a lot to cover here, so I’ll keep a bit of a record so as not to let bits fall between the cracks. As a bonus, a record will help keep me focused on the goal as well as track progress.
Man can I talk/type crap oir what?

2.1. Primary Goal

To reduce remote access when using internet or other non-local-sourced data.

3. Example

Basic example, creating a RemoteFileCache object and using it to only return a file once. Using the defaults any subsequent requests, within a one-day period for the same url, retrieves content from cache.

Basic RemoteFileCache Example
$rfc = new \Inane\Cache\RemoteFileCache();
$html = $rfc->get('http://example.com/files/example.html');

"No way!" I hear you say. "That is so simple!"
Yes, it is. But it is also very powerful.
The RemoteFileCache class implements the PSR-6 and PSR-16 interfaces so you can use it with any other library that implements those interfaces. It also has a few extra features that make it even more useful.