I am using a Spring boot application and there is a requirement to enable security by disabling the caching between the web-pages. As I understand, by default, Spring Security sets specific cache-control header values for us, without us having to configure anything.
But for my web application, the following response headers are not present. Cache-Control", "no-store" Pragma", "no-cache" Expires", "0" I have tried setting them using an interceptor(implementing HandlerInterceptor) and adding the following code in the preHandle, postHandle and afterCompletionMethod.
response.setHeader("Cache-Control", "no-store"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
response.setHeader("Expires", "0"); // Proxies.
Although the control comes to these methods and the header is set, when I inspect the web-browser, I don't see these headers.
What could be the reason?