What steps will reproduce the problem?
1. Add init-param turnOffETag to true, in web.xml.
<servlet>
<servlet-name>JSCSSMergeServlet</servlet-name>
<servlet-class>com.googlecode.webutilities.servlets.JSCSSMergeServlet</servlet-class>
... blah, blah,
<init-param>
<param-name>turnOffETag</param-name>
<param-value>true</param-value>
</init-param>
2. Request some js url
http://foo/bar.js
3. Request again
http://foo/bar.js
What is the expected output? What do you see instead?
I expected 304(Not modified) header response. But, status 200 and whole
resource.
What version of the product are you using? On what operating system?
webutilities-0.0.6.jar
Linux CentOS 5.3
jdk 1.6
Please provide any additional information below.
I guess, header named "Last-Modified" in request does not contain milliseconds,
but java.io.File.lastModified() returns time containing milliseconds.
in header "Last-Modified" : Sun, 16 Dec 2012 04:02:05 GMT
in file/server os "last modified: Sun, 16 Dec 2012 04:02:05.555 GMT
below source code always false.
private ResourceStatus isNotModified(HttpServletRequest request, HttpServletResponse response, List<String> resourcesToMerge) {
...blah blah
if (!isAnyResourceModifiedSince(resourcesToMerge, date.getTime(), context)) { // always false
if (lastModified > sinceTime) {
(Sun, 16 Dec 2012 04:02:05.555 GMT > Sun, 16 Dec 2012 04:02:05 GMT) // true
Original issue reported on code.google.com by gpard...@gmail.com on 16 Nov 2012 at 5:33
Original issue reported on code.google.com by
gpard...@gmail.com
on 16 Nov 2012 at 5:33