PHP Класс Codesleeve\AssetPipeline\Filters\ClientCacheFilter

Наследование: implements Codesleeve\Sprockets\Interfaces\ClientCacheInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$asset AssetCache AssetCache that asset pipeline will pass to us
$cache Assetic\Cache\CacheInterface Underlying cache driver we use

Открытые методы

Метод Описание
get ( string $key ) : string If we make it here then we have a cached version of this asset found in the underlying $cache driver. So we will check the header HTTP_IF_MODIFIED_SINCE and if that is not less than the last time we cached ($lastModified) then we will exit with 304 header.
getAssetCache ( ) : AssetCache Allows us to know our parent asset cache so we can do stuff like last modified time
getServerCache ( ) : Assetic\Cache\CacheInterface Allows us to get the existing cache
has ( string $key ) : boolean Proxy the $cache has to see if this asset has been cached yet or not
remove ( string $key ) : string Remove this key from session and also remove it from underlying cache driver
set ( string $key, string $value ) Proxy set to use the underlying cache driver
setAssetCache ( Assetic\Asset\AssetInterface $asset ) Allows us to set our parent asset cache (from asset pipeline) so we can do stuff like last modified time
setServerCache ( Assetic\Cache\CacheInterface $cache ) Allows us to delegate the cache driver to this client cache

Приватные методы

Метод Описание
getLastTimeModified ( string $key ) : string Store the last time this file was modified (which we don't know) so we just use the current datetime. We will store this date in $_SESSION so that next time we run we can re-use the datetime we first picked so that our cache isn't busted each time.

Описание методов

get() публичный Метод

If we make it here then we have a cached version of this asset found in the underlying $cache driver. So we will check the header HTTP_IF_MODIFIED_SINCE and if that is not less than the last time we cached ($lastModified) then we will exit with 304 header.
public get ( string $key ) : string
$key string
Результат string

getAssetCache() публичный Метод

Allows us to know our parent asset cache so we can do stuff like last modified time
public getAssetCache ( ) : AssetCache
Результат AssetCache

getServerCache() публичный Метод

Allows us to get the existing cache
public getServerCache ( ) : Assetic\Cache\CacheInterface
Результат Assetic\Cache\CacheInterface

has() публичный Метод

Proxy the $cache has to see if this asset has been cached yet or not
public has ( string $key ) : boolean
$key string
Результат boolean

remove() публичный Метод

Remove this key from session and also remove it from underlying cache driver
public remove ( string $key ) : string
$key string
Результат string

set() публичный Метод

Proxy set to use the underlying cache driver
public set ( string $key, string $value )
$key string
$value string

setAssetCache() публичный Метод

Allows us to set our parent asset cache (from asset pipeline) so we can do stuff like last modified time
public setAssetCache ( Assetic\Asset\AssetInterface $asset )
$asset Assetic\Asset\AssetInterface

setServerCache() публичный Метод

Allows us to delegate the cache driver to this client cache
public setServerCache ( Assetic\Cache\CacheInterface $cache )
$cache Assetic\Cache\CacheInterface

Описание свойств

$asset защищенное свойство

AssetCache that asset pipeline will pass to us
protected AssetCache $asset
Результат AssetCache

$cache защищенное свойство

Underlying cache driver we use
protected CacheInterface,Assetic\Cache $cache
Результат Assetic\Cache\CacheInterface