@@ -0,0 +1,2920 @@
+package woko.actions;%0A%0Aimport net.sourceforge.stripes.action.ActionBean;%0Aimport net.sourceforge.stripes.action.ActionBeanContext;%0Aimport net.sourceforge.stripes.action.Resolution;%0Aimport net.sourceforge.stripes.controller.ExecutionContext;%0Aimport net.sourceforge.stripes.controller.Interceptor;%0Aimport net.sourceforge.stripes.controller.Intercepts;%0Aimport net.sourceforge.stripes.controller.LifecycleStage;%0Aimport woko.facets.ResolutionFacet;%0Aimport woko.util.WLogger;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/**%0A * Interceptor that enforces no-caching policy for browsers, proxies etc. for%0A * requests handled by a ResolutionFacet.%0A *%0A * No-cache is enforced by default. ResolutionFacets can bypass this interceptor by%0A * implementing the markup interface %7B@link CustomCacheResolutionFacet%7D.%0A *%0A * Caching headers are%0A * https://developers.google.com/speed/docs/best-practices/caching?hl=fr%0A */%0A@Intercepts(%7BLifecycleStage.BindingAndValidation%7D)%0Apublic class WokoDisableCacheInterceptor implements Interceptor %7B%0A%0A    private static final WLogger logger = WLogger.getLogger(WokoDisableCacheInterceptor.class);%0A%0A    public static final String CACHE_CONTROL = %22Cache-Control%22;%0A    public static final String CACHE_CONTROL_VALUE = %22no-cache, no-store, must-revalidate%22;%0A    public static final String PRAGMA = %22Pragma%22;%0A    public static final String PRAGMA_VALUE = %22no-cache%22;%0A    public static final String EXPIRES = %22Expires%22;%0A%0A    public static void setNoCacheHeaders(HttpServletRequest request, HttpServletResponse response) %7B%0A        logger.debug(%22marking response headers for URI = %22 + request.getRequestURI() + %22, sessionId=%22 + request.getSession().getId());%0A        response.setHeader(CACHE_CONTROL, CACHE_CONTROL_VALUE); // HTTP 1.1.%0A        response.setHeader(PRAGMA, PRAGMA_VALUE); // HTTP 1.0.%0A        response.setDateHeader(EXPIRES, 0); // Proxies.%0A    %7D%0A%0A    /**%0A     * Markup interface that allows %3Ccode%3EResolutionFacet%3C/code%3Es to bypass the http response%0A     * headers generation. %3Ccode%3EWokoDisableCacheInterceptor%3C/code%3E won't set the caching headers for%0A     * resolution facets implementing this interface.%0A     */%0A    public static interface CustomCacheResolutionFacet %7B%7D%0A%0A    @Override%0A    public Resolution intercept(ExecutionContext context) throws Exception %7B%0A        ActionBean ab = context.getActionBean();%0A        if (ab instanceof WokoActionBean) %7B%0A            ResolutionFacet facet = ((WokoActionBean%3C?,?,?,?%3E)ab).getFacet();%0A            if (facet!=null && !(facet instanceof CustomCacheResolutionFacet)) %7B%0A                ActionBeanContext abc = context.getActionBeanContext();%0A                HttpServletResponse response = abc.getResponse();%0A                if (response!=null) %7B%0A                    setNoCacheHeaders(abc.getRequest(), response);%0A                %7D%0A            %7D%0A        %7D%0A        return context.proceed();%0A    %7D%0A%0A%0A%0A%7D%0A

fix #213 : WokoDisableCacheInterceptor enabled by default, sets the http response headers for no-cache policy for all ResolutionFacets. Can be skipped using markup interface for facets that wish to set the headers themselves.