samaxes / javaee-cache-filter Goto Github PK
View Code? Open in Web Editor NEWJava EE Cache Filter
License: Apache License 2.0
Java EE Cache Filter
License: Apache License 2.0
Chrome page speed suggests using this header to avoid issues with public proxies that do not detect the presence of a Content-Encoding header properly. See https://developers.google.com/speed/docs/best-practices/caching#LeverageProxyCaching
Any reason the "Pragma: no-cache" header is not included in the NoCacheFilter?
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.