Class CacheControlHandlerInterceptor

java.lang.Object
de.hybris.platform.webservicescommons.interceptors.CacheControlHandlerInterceptor
All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor, org.springframework.web.servlet.HandlerInterceptor

public class CacheControlHandlerInterceptor extends Object implements org.springframework.web.servlet.AsyncHandlerInterceptor
Handler interceptor that adds a Cache-Control header to the response based on @link{CacheControl} annotation.
  • Constructor Details

    • CacheControlHandlerInterceptor

      public CacheControlHandlerInterceptor()
  • Method Details

    • preHandle

      public final boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws Exception
      Specified by:
      preHandle in interface org.springframework.web.servlet.HandlerInterceptor
      Throws:
      Exception
    • isEligibleForCacheControl

      protected boolean isEligibleForCacheControl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler)
      Indicates whether the given request and response are eligible for Cache-Control generation.
      Parameters:
      request - the HTTP request
      response - the HTTP response
      handler - handler (or HandlerMethod)
      Returns:
      true if eligible; false otherwise
    • getCacheControlAnnotation

      protected CacheControl getCacheControlAnnotation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler)
    • createCacheControlHeaderField

      protected String createCacheControlHeaderField(CacheControl cacheAnnotation)