kpicaza/redis-etag-cache

This package helps to implement etag cache.

v0.0.2 2016-06-10 22:47 UTC

This package is auto-updated.

Last update: 2024-12-18 09:35:23 UTC


README

Scrutinizer Code Quality Code Coverage Build Status

Requirements:

This package depends on Predis. See installation instruction at Github repo.

Installation:

composer require kpicaza/redis-etag-cache

Usage:

<?php

use Kpicaza\RedisETagCache\RedisETagGenerator;
use Kpicaza\RedisETagCache\RedisETagCache;
use Predis\Client;

$client = new Client();
$eTagGenerator = new RedisETagGenerator();
$eTag = new RedisETagCache($eTagGenerator);

// Set ETag.
$eTag = $eTag->setETag(sprintf('%s_%s', $method, $uri), $response->getContent());

// Get ETag.
$eTag = $this->cache->getETag(sprintf('%s_%s', $method, $uri))