diff --git a/backend/console/src/main/java/com/alibaba/higress/console/WebMvcInitializer.java b/backend/console/src/main/java/com/alibaba/higress/console/WebMvcInitializer.java index 08b6e582..1c1a1151 100644 --- a/backend/console/src/main/java/com/alibaba/higress/console/WebMvcInitializer.java +++ b/backend/console/src/main/java/com/alibaba/higress/console/WebMvcInitializer.java @@ -12,6 +12,7 @@ */ package com.alibaba.higress.console; +import java.time.Duration; import java.util.Arrays; import java.util.List; @@ -19,6 +20,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; +import org.springframework.http.CacheControl; import org.springframework.lang.NonNull; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; @@ -36,7 +38,8 @@ public class WebMvcInitializer implements WebMvcConfigurer { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/*").addResourceLocations("classpath:/static/").setUseLastModified(true) + registry.addResourceHandler("/*").addResourceLocations("classpath:/static/") + .setCacheControl(CacheControl.maxAge(Duration.ZERO).mustRevalidate()).setUseLastModified(true) .resourceChain(true).addResolver(new PathResourceResolver() { @Override protected Resource resolveResourceInternal(HttpServletRequest request, @NonNull String requestPath,