Git Product home page Git Product logo

javaee-cache-filter's People

Contributors

jyeary avatar samaxes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javaee-cache-filter's Issues

Pragma: no-cache ?

Any reason the "Pragma: no-cache" header is not included in the NoCacheFilter?

ExpirationTime does not account for timezone

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.

no-cache + no-store = no etag

Regarding the NoCache filter. It sets both no-cache and no-store. But I was looking for a solution that only sets no-cache. So I can still benefit from a revalidation using Etags. See e.g. this article on developers.google which explains the principles excellently.

So I propose making no-store optional. I'll make a pull request.

By the way, I think no-store obsoletes no-cache, since it would not allow storing anything at all to begin with. But I suppose it does no harm to have both.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.