我们有一个Spring Boot应用程序在Openshift上运行,我们可以这样配置Cache-Control头:
在HTTP响应中有两个Cache-Control头:
我们期望出现第一个标题,但我们不知道第二个标题从哪里来的。(请注意第二个标题名称中的小写字母c。)
有任何想法是第二个标题来自何处以及如何去掉它吗?
@Configuration
@EnableWebSecurity
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.headers().cacheControl().disable().addHeaderWriter((httpServletRequest, httpServletResponse) -> {
httpServletResponse.setHeader(HttpHeaders.CACHE_CONTROL, "public, max-age=86400");
});
}
}
在HTTP响应中有两个Cache-Control头:
$ curl --header https://<our-url> --head
HTTP/1.1 200 Connection established
HTTP/1.1 200
...
Cache-Control: public, max-age=86400
...
Cache-control: private
我们期望出现第一个标题,但我们不知道第二个标题从哪里来的。(请注意第二个标题名称中的小写字母c。)
有任何想法是第二个标题来自何处以及如何去掉它吗?