Example usage for org.springframework.web.servlet.mvc WebContentInterceptor setUseCacheControlNoStore

List of usage examples for org.springframework.web.servlet.mvc WebContentInterceptor setUseCacheControlNoStore

Introduction

In this page you can find the example usage for org.springframework.web.servlet.mvc WebContentInterceptor setUseCacheControlNoStore.

Prototype

@Deprecated
public final void setUseCacheControlNoStore(boolean useCacheControlNoStore) 

Source Link

Document

Set whether to use the HTTP 1.1 cache-control header value "no-store" when preventing caching.

Usage

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  ww  w .ja v  a 2 s . c om*/
 */
@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);
}