List of usage examples for org.springframework.web.servlet.mvc WebContentInterceptor setCacheSeconds
public final void setCacheSeconds(int seconds)
From source file:org.bonitasoft.web.designer.config.WebMvcConfiguration.java
/** * In Internet Explorer http requests are cached by default. It's a problem when we want to provide a REST API. This interceptor * adds headers in the responses to desactivate the cache. NB : static resources are cached but managed by the resource handlers * * @param registry//from w w w. ja va2 s .co m */ @Override public void addInterceptors(InterceptorRegistry registry) { WebContentInterceptor interceptor = new WebContentInterceptor(); interceptor.setCacheSeconds(0); interceptor.setUseExpiresHeader(true); interceptor.setUseCacheControlHeader(true); interceptor.setUseCacheControlNoStore(true); registry.addInterceptor(interceptor); }
From source file:org.wallride.autoconfigure.WebAdminConfiguration.java
@Override public void addInterceptors(InterceptorRegistry registry) { WebContentInterceptor webContentInterceptor = new WebContentInterceptor(); webContentInterceptor.setCacheSeconds(0); webContentInterceptor.setUseExpiresHeader(true); webContentInterceptor.setUseCacheControlHeader(true); webContentInterceptor.setUseCacheControlNoStore(true); registry.addInterceptor(webContentInterceptor); registry.addInterceptor(defaultModelAttributeInterceptor); registry.addInterceptor(setupRedirectInterceptor); }