PHP 클래스 Kevinrob\GuzzleCache\Strategy\PrivateCacheStrategy
Pay attention to share storage between application with caution!
For example, a response with cache-control header "private, max-age=60"
will be cached by this strategy.
The rules applied are from RFC 7234.
파일 보기
프로젝트 열기: kevinrob/guzzle-cache-middleware
1 사용 예제들
보호된 프로퍼티들
공개 메소드들
메소드 |
설명 |
|
__construct ( Kevinrob\GuzzleCache\Storage\CacheStorageInterface $cache = null ) |
|
|
cache ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean |
|
|
fetch ( Psr\Http\Message\RequestInterface $request ) : CacheEntry | null |
Return a CacheEntry or null if no cache. |
|
update ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean |
|
|
보호된 메소드들
메소드 |
설명 |
|
getCacheKey ( Psr\Http\Message\RequestInterface $request ) : string |
|
|
getCacheObject ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : CacheEntry | null |
|
|
메소드 상세
public __construct ( Kevinrob\GuzzleCache\Storage\CacheStorageInterface $cache = null ) |
$cache |
Kevinrob\GuzzleCache\Storage\CacheStorageInterface |
|
public cache ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean |
$request |
Psr\Http\Message\RequestInterface |
|
$response |
Psr\Http\Message\ResponseInterface |
|
리턴 |
boolean |
true if success |
Return a CacheEntry or null if no cache.
public fetch ( Psr\Http\Message\RequestInterface $request ) : CacheEntry | null |
$request |
Psr\Http\Message\RequestInterface |
|
리턴 |
Kevinrob\GuzzleCache\CacheEntry | null |
|
protected getCacheKey ( Psr\Http\Message\RequestInterface $request ) : string |
$request |
Psr\Http\Message\RequestInterface |
|
리턴 |
string |
|
protected getCacheObject ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : CacheEntry | null |
$request |
Psr\Http\Message\RequestInterface |
|
$response |
Psr\Http\Message\ResponseInterface |
|
리턴 |
Kevinrob\GuzzleCache\CacheEntry | null |
entry to save, null if can't cache it |
public update ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean |
$request |
Psr\Http\Message\RequestInterface |
|
$response |
Psr\Http\Message\ResponseInterface |
|
리턴 |
boolean |
true if success |
프로퍼티 상세
protected string[] $ageKey |
리턴 |
string[] |
|
$statusAccepted 보호되어 있는 프로퍼티
protected int[] $statusAccepted |
리턴 |
int[] |
|
protected CacheStorageInterface,Kevinrob\GuzzleCache\Storage $storage |
리턴 |
Kevinrob\GuzzleCache\Storage\CacheStorageInterface |
|