ch.mfrey.thymeleaf.extras.cache.CacheDialect Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of thymeleaf-cache-dialect Show documentation
Show all versions of thymeleaf-cache-dialect Show documentation
A dialect for Thymeleaf that allows you to do partial page caching.
Some parts of our webpage will never change during the lifetime of the application or a usersession, but the part should still be dynamic in the beginning.
Working with Thymeleaf 3.0.0+ (3.0.0.RELEASE and its dependencies included)
package ch.mfrey.thymeleaf.extras.cache;
import java.util.HashSet;
import java.util.Set;
import org.thymeleaf.dialect.AbstractDialect;
import org.thymeleaf.processor.IProcessor;
public class CacheDialect extends AbstractDialect {
public static final String DIALECT_NAMESPACE = "http://www.thymeleaf.org/extras/cache";
public static final String DIALECT_PREFIX = "cache";
public static final String CACHE_PREFIX = "CacheDialect_";
/**
* {@inheritDoc}
*/
@Override
public Set getProcessors() {
HashSet processors = new HashSet();
processors.add(new CacheProcessor());
processors.add(new CacheAddProcessor());
processors.add(new CacheEvictProcessor());
return processors;
}
public String getPrefix() {
return DIALECT_PREFIX;
}
public boolean isLenient() {
return false;
}
}