Commit 37605e35 authored by Brian Clozel's avatar Brian Clozel

Document devtools influence on HTTP cache headers

This commits documents the fact that, amongst its property defaults,
devtools is disabling the HTTP cache headers when serving static
resources with Spring MVC.

Fixes gh-7516
parent 26643ef4
...@@ -776,10 +776,13 @@ supported with both the Maven and Gradle plugins. ...@@ -776,10 +776,13 @@ supported with both the Maven and Gradle plugins.
[[using-boot-devtools-property-defaults]] [[using-boot-devtools-property-defaults]]
=== Property defaults === Property defaults
Several of the libraries supported by Spring Boot use caches to improve performance. For Several of the libraries supported by Spring Boot use caches to improve performance. For
example, Thymeleaf will cache templates to save repeatedly parsing XML source files. example, <<spring-boot-features#boot-features-spring-mvc-template-engines,template engines>>
will cache compiled templates to avoid repeatedly parsing template files.
Also, Spring MVC can add HTTP caching headers to responses when serving static resources.
Whilst caching is very beneficial in production, it can be counter productive during Whilst caching is very beneficial in production, it can be counter productive during
development. If you make a change to a template file in your IDE, you'll likely want to development, preventing you from seeing the changes you just made in your application.
immediately see the result. For this reason, spring-boot-devtools will disable those caching options by default.
Cache options are usually configured by settings in your `application.properties` file. Cache options are usually configured by settings in your `application.properties` file.
For example, Thymeleaf offers the `spring.thymeleaf.cache` property. Rather than needing For example, Thymeleaf offers the `spring.thymeleaf.cache` property. Rather than needing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment