StoreInterface
in
Interface implemented by HTTP cache stores.
Tags
Table of Contents
- cleanup() : mixed
- Cleanups storage.
- invalidate() : mixed
- Invalidates all cache entries that match the request.
- isLocked() : bool
- Returns whether or not a lock exists.
- lock() : bool|string
- Locks the cache for a given Request.
- lookup() : Response|null
- Locates a cached Response for the Request provided.
- purge() : bool
- Purges data for the given URL.
- unlock() : bool
- Releases the lock for the given Request.
- write() : string
- Writes a cache entry to the store for the given Request and Response.
Methods
cleanup()
Cleanups storage.
public
cleanup() : mixed
Return values
mixed —invalidate()
Invalidates all cache entries that match the request.
public
invalidate(Request $request) : mixed
Parameters
- $request : Request
Return values
mixed —isLocked()
Returns whether or not a lock exists.
public
isLocked(Request $request) : bool
Parameters
- $request : Request
Return values
bool —true if lock exists, false otherwise
lock()
Locks the cache for a given Request.
public
lock(Request $request) : bool|string
Parameters
- $request : Request
Return values
bool|string —true if the lock is acquired, the path to the current lock otherwise
lookup()
Locates a cached Response for the Request provided.
public
lookup(Request $request) : Response|null
Parameters
- $request : Request
Return values
Response|null —purge()
Purges data for the given URL.
public
purge(string $url) : bool
Parameters
- $url : string
Return values
bool —true if the URL exists and has been purged, false otherwise
unlock()
Releases the lock for the given Request.
public
unlock(Request $request) : bool
Parameters
- $request : Request
Return values
bool —False if the lock file does not exist or cannot be unlocked, true otherwise
write()
Writes a cache entry to the store for the given Request and Response.
public
write(Request $request, Response $response) : string
Existing entries are read and any that match the response are removed. This method calls write with the new list of cache entries.
Parameters
Return values
string —The key under which the response is stored