mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Add cacheable switch to Thymeleaf template resolver
User can set spring.template.cache=false to change the behaviour
This commit is contained in:
parent
e1bac589fb
commit
697c210155
@ -67,6 +67,9 @@ public class ThymeleafAutoConfiguration {
|
||||
@Value("${spring.template.suffix:.html}")
|
||||
private String suffix = ".html";
|
||||
|
||||
@Value("${spring.template.cache:true}")
|
||||
private boolean cacheable;
|
||||
|
||||
@Value("${spring.template.mode:HTML5}")
|
||||
private String templateMode = "HTML5";
|
||||
|
||||
@ -94,6 +97,7 @@ public class ThymeleafAutoConfiguration {
|
||||
resolver.setPrefix(this.prefix);
|
||||
resolver.setSuffix(this.suffix);
|
||||
resolver.setTemplateMode(this.templateMode);
|
||||
resolver.setCacheable(this.cacheable);
|
||||
return resolver;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user