@Override public CacheDirective getCacheDirective(Command command, ExecutionContext executionContext, RuntimeMetadata metadata) throws TranslatorException { if (cachePattern != null && cachePattern.matcher(command.toString()).matches()) { //return a new cache directive with defaults and ttl set CacheDirective cacheDirective = new CacheDirective(); cacheDirective.setTtl(cacheTtl); return cacheDirective; } return delegate.getCacheDirective(command, executionContext, metadata); }