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

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

Introduction

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

Prototype

@Deprecated
public final void setUseExpiresHeader(boolean useExpiresHeader) 

Source Link

Document

Set whether to use the HTTP 1.0 expires header.

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/*w  w w. ja va 2 s. c o  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);
}