Sunday, November 21, 2010

Cacheable Command ! a really cool performance addition

If you are using Dynacache for you commerce site. This functionality is one of the coolest features that could be incorporated to improve caching results drastically.
It has 2 parts:
1. Writing the actual cache able command extending CacheableCommandImpl
2. Making the entry in cachespec.xml

In the command implementation, mandatory methods to be implemented
public void setOutputProperties(TargetableCommand fromCommand)
public void performExecute() throws Exception
public boolean isReadyToCallExecute() {

Good candidates for this kind of caching would be any complex computational logic such as Geo lookup, ATP messages or any complex logic that requires lot of computation and if the underlying data changes dynamically, will need to also build the cache invalidation with it.

No comments:

Post a Comment