Skip to content Skip to sidebar Skip to footer

Disable Browser Caching Html5

I would like to know how to disable the browser cache, using HTML5. I found this useful post (How to control web page caching, across all browsers?), but it contains the info only

Solution 1:

In order to disable the browser cache with HTML5, you can act on the Spring Security configuration class, as in the example:

@Configuration@EnableWebMvcSecurity
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
...
@Overrideprotectedvoidconfigure(final HttpSecurity http) {
   ...
   http.headers().cacheControl().disable();
}

Solution 2:

For disable the browser cache with HTML5 in response header you can view this post automatically add header to every response. For application made in Spring annotation-based see https://stackoverflow.com/a/49431665/4939245

Post a Comment for "Disable Browser Caching Html5"