Class CacheControlHeadersWriter
java.lang.Object
org.springframework.security.web.header.writers.CacheControlHeadersWriter
- All Implemented Interfaces:
HeaderWriter
Inserts headers to prevent caching if no cache control headers have been specified.
Specifically it adds the following headers:
- Cache-Control: no-cache, no-store, max-age=0, must-revalidate
- Pragma: no-cache
- Expires: 0
- Since:
- 3.2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
writeHeaders
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Create aHeader
instance.
-
Constructor Details
-
CacheControlHeadersWriter
public CacheControlHeadersWriter()Creates a new instance
-
-
Method Details
-
writeHeaders
public void writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:HeaderWriter
Create aHeader
instance.- Specified by:
writeHeaders
in interfaceHeaderWriter
- Parameters:
request
- the requestresponse
- the response
-