SelectiveCacheInterface

Optional extension of CacheInterface for backends that only want to cache some of the cacheable subsystems (for example font subsets but not images).

Namespace: Com\Tecnick\Pdf\Cache

Extends: CacheInterface

File: SelectiveCacheInterface.php line 40

Optional extension of CacheInterface for backends that only want to cache some of the cacheable subsystems (for example font subsets but not images).

A plain CacheInterface is consulted for every cacheable subsystem. When an implementation also implements this interface, each subsystem is wired only when supports() returns true for its type; unsupported types are disabled and the cache is never queried nor written for them.

Tags

Constants

TYPE_FONT

File: CacheInterface.php line 61

public mixed TYPE_FONT = 'font'

TYPE_IMAGE

File: CacheInterface.php line 66

public mixed TYPE_IMAGE = 'image'

Methods

get()

File: CacheInterface.php line 75

public get(string $key) : mixed

Parameters

  • $key : string: Cache key.

Return values

mixed —

Stored value, or null when absent.

set()

File: CacheInterface.php line 83

public set(string $key, mixed $value) : void

Parameters

  • $key : string: Cache key.
  • $value : mixed: Value to store.

supports()

File: SelectiveCacheInterface.php line 49

public supports(CacheInterface::TYPE_* $type) : bool

Parameters

  • $type : CacheInterface::TYPE_*: Subsystem type to query.

Return values

bool —

True to enable caching for the type, false to disable it.