question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Thymeleaf templates cache even when spring.template.cache: false

See original GitHub issue

When editing Thymeleaf templates, a server restart is required to view the updates.

Even with the following setting in application.properties:

# Allow Thymeleaf templates to be reloaded at dev time
spring.template.cache: false

To reproduce: With spring-boot-sample-web-ui, run it with mvn spring-boot:run and edit any of the templates, they don’t reload after server has been started.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:28 (10 by maintainers)

github_iconTop GitHub Comments

62reactions
yanhua365commented, Sep 23, 2013

It works!

I user IntelliJ Idea debug the application.

After add application.properties with:

spring.thymeleaf.cache: false

Then,after edit html template, must use CTRL+F9 to make the project.

In this way,it works fine for me.

49reactions
oak1980commented, Jul 19, 2017

Springboot with IntelliJ and configurations in src/main/resources/application.properties I put in the following relative path, and started the Application.main(…) from IntelliJ:

# Templates reloading during development
spring.thymeleaf.prefix=file:src/main/resources/templates/
spring.thymeleaf.cache=false

# Static resources reloading during development
spring.resources.static-locations=file:src/main/resources/static/
spring.resources.cache-period=0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Thymeleaf cache and security in Spring Boot - Stack Overflow
Actually the spring.thymeleaf.cache property has nothing to do with security, but more with performance. If you disable the Thymeleaf cache, ...
Read more >
83. Hot swapping - Spring
1 Thymeleaf templates. If you are using Thymeleaf, then set spring.thymeleaf.cache to false . See ThymeleafAutoConfiguration for ...
Read more >
Fix Hot Reload of Thymeleaf-Templates In spring-boot:run | juplo
Some say, that you have to disable caching by setting spring.template.cache=false and spring.thymeleaf.cache=false and/or run the application in ...
Read more >
Spring Boot and Thymeleaf: Reload templates and static ...
thymeleaf.cache to false disables template caching whereas spring.thymeleaf.prefix allows specifying prefix that gets prepended to view names ...
Read more >
Spring: Disable caching of template and static files-Springboot
When it comes to spring-boot , by default the template options such as Thymeleaf and FreeMarker are configured to be cached. It is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found