Nextcloud PHP API (master)

ICacheFactory

Interface ICacheFactory

Tags
since
7.0.0

Table of Contents

Methods

createDistributed()  : ICache
create a distributed cache instance
createInMemory()  : ICache
Create an in-memory cache instance
createLocal()  : ICache
create a local cache instance
createLocking()  : IMemcache
create a cache instance for storing locks
isAvailable()  : bool
Check if any memory cache backend is available
isLocalCacheAvailable()  : bool
Check if a local memory cache backend is available

Methods

createDistributed()

create a distributed cache instance

public createDistributed([string $prefix = '' ]) : ICache
Parameters
$prefix : string = ''
Tags
since
13.0.0
Return values
ICache

createInMemory()

Create an in-memory cache instance

public createInMemory([int $capacity = 512 ]) : ICache

Useful for remembering values inside one process. Cache memory is cleared when the object is garbage-collected. Implementation may also expire keys earlier when the TTL is reached or too much memory is consumed.

Cache keys are local to the cache object. When building two in-memory caches, there is no data exchange between the instances.

Parameters
$capacity : int = 512

maximum number of cache keys

Tags
since
28.0.0
Return values
ICache

createLocal()

create a local cache instance

public createLocal([string $prefix = '' ]) : ICache
Parameters
$prefix : string = ''
Tags
since
13.0.0
Return values
ICache

createLocking()

create a cache instance for storing locks

public createLocking([string $prefix = '' ]) : IMemcache
Parameters
$prefix : string = ''
Tags
since
13.0.0
Return values
IMemcache

isAvailable()

Check if any memory cache backend is available

public isAvailable() : bool
Tags
since
7.0.0
Return values
bool

isLocalCacheAvailable()

Check if a local memory cache backend is available

public isLocalCacheAvailable() : bool
Tags
since
14.0.0
Return values
bool

        
On this page

Search results