@Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        String requestURI = ((HttpServletRequest) request).getRequestURI();
        String v = request.getParameter("v"); //$NON-NLS-1$
        if (v == null){
            v = ""; //$NON-NLS-1$
        }
        Date now = new Date();
        HttpServletResponse httpResponse = (HttpServletResponse) response;
        httpResponse.setDateHeader("Date", now.getTime()); //$NON-NLS-1$

        // By default, cache aggressively.  However, if a file contains '.nocache.' as part of its
        // name, then tell the browser not to cache it.  Also, if the version of the resource being
        // requested contains 'SNAPSHOT' then don't cache.
        if (requestURI.contains(".nocache.") //$NON-NLS-1$
                || v.contains("SNAPSHOT") //$NON-NLS-1$
                || "true".equals(System.getProperty("apiman.resource-caching.disabled", "false"))) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        {
            HttpCacheUtil.disableHttpCaching(httpResponse);
        } else {
            httpResponse.setDateHeader("Expires", expiresInOneYear(now)); //$NON-NLS-1$
            // Cache for one year
            httpResponse.setHeader("Cache-control", "public, max-age=31536000"); //$NON-NLS-1$ //$NON-NLS-2$
        }

        chain.doFilter(request, response);
    }
@see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
common/servlet/src/main/java/io/apiman/common/servlet/ResourceCacheControlFilter.java