Skip to content

ExpirationTime does not account for timezone #4

@jhoglin

Description

@jhoglin

With this in web.xml

<init-param>
    <param-name>expirationTime</param-name>
    <param-value>14400</param-value>
</init-param>

When fetching a resource at 2014-10-16 14:39:40 in GMT +2 (with daylight savings active, +1 normally) This is in Sweden.

HTTP/1.1 200 OK
Cache-Control: public, max-age=14400
Date: Thu, 16 Oct 2014 12:39:40 GMT
Content-Length: 82718
Content-Type: text/css
Expires: Thu, 16 Oct 2014 16:39:40 GMT
Last-Modified: Thu, 16 Oct 2014 11:55:58 GMT
X-Powered-By: Servlet/2.5 JSP/2.1

In init of CacheFilter the time difference to GMT should be observed and accounted for.

seconds = Long.valueOf(filterConfig.getInitParameter(CacheConfigParameter.EXPIRATION_TIME.getName()));

This is off-course only interesting when using short cache times, if we cache it for 6 months the few hours means nothing obviously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions