Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When putting objects to the cache you can restrict their lifetime. In this case, instead of checking the validity of cached objects, you can simply let them expire over time.

Rebuild the cache on non-persistent implementations after server restart 

Warning

Whether cache is persistent depends on the underlying implementation. For non-persistent implementations the cache must be rebuilt after server restart. See Cache implementations for more.

Implementations:

Not persistent 

EhCache with free license

Persistent

EhCache with eh-cache commercial license

MemCache


Get the cache

Achieve an instance of 

Javadoc resource link
0info.magnolia.module.cache.Cache
classNameinfo.magnolia.module.cache.Cache
renderTypeasynchronous
.  This is your cache to operate on. Give it a name which must be unique within the system.

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
modules

 

Mgnl f
cache

 

Mgnl f
config

 

Mgnl n
cacheFactory

 

Mgnl n
caches

 

Mgnl n
default

 


Mgnl n
fooBarCache

 

Mgnl p
extends

../default

Mgnl p
timeToLiveSeconds

300

Mgnl n
persistence

 


Mgnl p
strategy

none

(warning) The /modules/cache/config/cacheFactory/caches/fooBarCache node defines the cache name. fooBarCache is the "name" of the cache which was also used above when acquiring the Cache object within Java code.

...