[ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-2755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=27056#action_27056
 ] 

Jan Haderka commented on MAGNOLIA-2755:
---------------------------------------

related bit of code from the old cache (just to keep it somewhere while getting 
rid of the old code)
{code}
    public boolean ifModifiedSince(HttpServletRequest request, long 
lastModified) {
        try {
            long headerValue = request.getDateHeader("If-Modified-Since");
            if (headerValue != -1) {
                // If an If-None-Match header has been specified, if modified 
since
                // is ignored.
                if ((request.getHeader("If-None-Match") == null)
                    && (lastModified > 0 && lastModified <= headerValue + 
1000)) {
                    return false;
                }
            }
        }
        catch (IllegalArgumentException illegalArgument) {
            return true;
        }
        return true;
    }
{code}

> Magnolia Cache returns 200 for 'docroot' CachedPage if request includes 
> If-None-Match header
> --------------------------------------------------------------------------------------------
>
>                 Key: MAGNOLIA-2755
>                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2755
>             Project: Magnolia
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 4.0.1
>         Environment: Magnolia Community 4.0.1 on Tomcat 6.0.16
>            Reporter: Dean Arnold
>            Assignee: Boris Kraft
>            Priority: Critical
>             Fix For: 4.3
>
>
> The current AbstractExecutor.ifModifiedSince method is always returning true 
> if the request for a cached page includes the 'If-None-Match' header.
> The 'If-None-Match' header is/should be set by the browser as a request 
> header if the prior response for a page/resource included the Etag header, 
> which all 'docroot' cached responses from Magnolia (on Tomcat) do.
> Rather than returning 'true' to the IfModifiedSince method, if the 
> 'If-None-Match' header is present in the request, the cache should compare 
> its value with that of the 'Etag' header that is stored with the CachedPage 
> headers. If the ETag header is not present, the cache should fall back on 
> last modified date.
> N.B. the Etag header being added to 'docroot' resources e.g. css/js/images 
> etc. It is not added for Magnolia repository managed content.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to