From 37605e3576df21bc9e54eba37225f3d05b8c342c Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Thu, 15 Dec 2016 17:14:19 +0100 Subject: [PATCH] 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 --- .../src/main/asciidoc/using-spring-boot.adoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc index 587b2484ca4..b6f90a430a7 100644 --- a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -776,10 +776,13 @@ supported with both the Maven and Gradle plugins. [[using-boot-devtools-property-defaults]] === Property defaults 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, <> +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 -development. If you make a change to a template file in your IDE, you'll likely want to -immediately see the result. +development, preventing you from seeing the changes you just made in your application. +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. For example, Thymeleaf offers the `spring.thymeleaf.cache` property. Rather than needing