Class SimpleCacheKeyResolver

java.lang.Object
org.broadleafcommerce.presentation.cache.service.SimpleCacheKeyResolver
All Implemented Interfaces:
TemplateCacheKeyResolverService

public class SimpleCacheKeyResolver extends Object implements TemplateCacheKeyResolverService
Default implementation of TemplateCacheKeyResolverService that returns a concatenation of a templateName and cacheKey. If the cacheKey is set to none, null is returned resulting in no cache.
Author:
Brian Polster (bpolster)
  • Constructor Details

    • SimpleCacheKeyResolver

      public SimpleCacheKeyResolver()
  • Method Details

    • resolveCacheKey

      public String resolveCacheKey(String tagName, Map<String,String> tagAttributes, String documentName, Integer lineNumber, BroadleafTemplateContext context)
      Returns a concatenation of the templateName and cacheKey separated by an "_". If cacheKey is null, only the templateName is returned.

      If cacheKey is "none" then null will be returned causing the template not to be cached.

      Specified by:
      resolveCacheKey in interface TemplateCacheKeyResolverService
      Parameters:
      tagName - the tag name that the cache processor is running in
      tagAttributes - the attributes used in the tag or ones added by the cache processor
      documentName - the name of the template
      lineNumber - the line that the cache processor is on
      context - the context that the processor is executing in
      Returns:
      See Also:
    • getStringValue

      protected String getStringValue(String attrName, Map<String,String> tagAttributes, boolean removeAttribute, BroadleafTemplateContext context)