public static void markCacheableForever(HttpServletResponse response){
  long expiresAfterMillis=System.currentTimeMillis() + ONE_YEAR_MILLIS;
  response.setHeader(ServletConstants.HTTP_PRAGMA,"");
  response.setDateHeader(ServletConstants.HTTP_EXPIRES,expiresAfterMillis);
  response.setHeader(ServletConstants.HTTP_CACHE_CONTROL,ServletConstants.HTTP_CACHE_CONTROL_PRIVATE);
  response.addHeader(ServletConstants.HTTP_CACHE_CONTROL,ServletConstants.HTTP_CACHE_CONTROL_MAX_AGE + ONE_YEAR_MILLIS);
}

public static void markCacheableForever ( HttpServletResponse response ) { long expiresAfterMillis = System . currentTimeMillis ( ) + ONE_YEAR_MILLIS ; response . setHeader ( ServletConstants . HTTP_PRAGMA , "" ) ; response . setDateHeader ( ServletConstants . HTTP_EXPIRES , expiresAfterMillis ) ; response . setHeader ( ServletConstants . HTTP_CACHE_CONTROL , ServletConstants . HTTP_CACHE_CONTROL_PRIVATE ) ; response . addHeader ( ServletConstants . HTTP_CACHE_CONTROL , ServletConstants . HTTP_CACHE_CONTROL_MAX_AGE + ONE_YEAR_MILLIS ) ; }
marks the resource returned to a web client to be stored in cache for a very long time . the resource is marked to be cached privately , i . e . on the client only , not in intermediate caches like proxies .
