ePages 7.25.0 - DE_EPAGES/Object/API/PageCache/Base.pm

Package DE_EPAGES::Object::API::PageCache::Base

Backend interface for page cache handling.

Functions

clearAllCaches
clearObjectCache
clearSiteCache
clearStoreCache
expire
get
lastModified
new
remove
set

clearAllCaches

Deletes all pages of all databases from the cache.

Syntax
$PageCache->clearAllCaches;

clearObjectCache

Deletes all pages of a given object from the cache.

Syntax
$PageCache->clearObjectCache($Object);
Input
$Object (DE_EPAGES::Object::API::Object::Object)
object

clearSiteCache

Deletes all pages of a given site from the cache.

Syntax
$PageCache->clearSiteCache($Site);
Input
$Site (DE_EPAGES::Object::API::Object::Site)
object

clearStoreCache

Deletes all pages of the current database from the cache.

Syntax
$PageCache->clearStoreCache;

expire

Invalidates a page in the cache.

Syntax
$Backend->expire( $Object, $CacheKeyPart );
Input
$Object (DE_EPAGES::Object::API::Object::Object)
object
$CacheKeyPart (string)
cache key, unique for this object

get

Gets the content of a page from the cache. Returns undef if the page does not exist in the cache or has expired.

Syntax
$Content = $Backend->get( $Object, $CacheKeyPart );
Example
$Content = $Backend->get( $Object, 'View_en_GB' );
Input
$Object (DE_EPAGES::Object::API::Object::Object)
object
$CacheKeyPart (string)
cache key, unique for this object
Return
$Content (string)
page content or undef

lastModified

Returns the time when the content has been written to the cache. Returns undef if the page does not exist in the cache or has expired.

Syntax
$LastModified = $Backend->lastModified( $Object, $CacheKeyPart );
Input
$Object (DE_EPAGES::Object::API::Object::Object)
object
$CacheKeyPart (string)
cache key, unique for this object
Return
$LastModified (int)
epoch value

new

Creates a PageCache backend object.

Syntax
$Backend = DE_EPAGES::Object::API::PageCache::Base->new( %Options );
Example
$Backend = DE_EPAGES::Object::API::PageCache::Base->new( Site => $Site );
Input
%Options
options
  • Site - Site object - object
Return
$Backend (DE_EPAGES::Object::API::PageCache::Base)
PageCache backend object

remove

Deletes a page from the cache.

Syntax
$Backend->remove( $Object, $CacheKeyPart );
Input
$Object (DE_EPAGES::Object::API::Object::Object)
object
$CacheKeyPart (string)
cache key, unique for this object

set

Writes the content of a page to the cache.

Syntax
$Backend->set( $Object, $CacheKeyPart, $Content );
Example
$Backend->set( $Object, 'View_en_GB', $Content );
Input
$Object (DE_EPAGES::Object::API::Object::Object)
object
$CacheKeyPart (string)
cache key, unique for this object
$Content (string)
page content