From fc535fe27c84c57f9c7ed154f136a2458d400162 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 1 Nov 2016 15:37:06 -0400 Subject: [PATCH] Disable resource chain cache when DevTools is enabled If the resource chain is used, such as by using the `"spring.resources.chain.strategy.content.enabled"` property, resource chain caching can prevent the developer from seeing changes made to resources, so that caching should be disabled when DevTools is enabled. This commit sets the `"spring.resources.chain.cache"` property to `true` when devtools is enabled. --- .../boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java index 4fbf54f9b5..58701788de 100755 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java @@ -54,6 +54,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro properties.put("server.session.persistent", "true"); properties.put("spring.h2.console.enabled", "true"); properties.put("spring.resources.cache-period", "0"); + properties.put("spring.resources.chain.cache", "false"); properties.put("spring.template.provider.cache", "false"); properties.put("spring.mvc.log-resolved-exception", "true"); PROPERTIES = Collections.unmodifiableMap(properties);