You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by Paul Tomblin <pt...@xcski.com> on 2009/08/10 22:27:16 UTC

Is this a bug?

I was wondering why nutch was refetching pages that haven't changed in
a decade, when I discovered this code in
org.apache.nutch.protocol.http.HttpResponse.java:

      if (datum.getModifiedTime() > 0) {
        reqStr.append("If-Modified-Since: " +
HttpDateFormat.toString(datum.getModifiedTime()));
        reqStr.append("\r\n");
      }

Shouldn't it be sending the time of the last fetch rather than the
last modification?  At least in my testing, "last modification" is 0,
but last fetch is correctly set.  Maybe that should be

if (datum.getModifiedTime() > 0) {
   reqStr.append("If-Modified-Since:" +
HttpDateFormat.toString(datum.getModifiedTime());
   reqStr.append("\r\n");
} else if (datum.getFetchTime() > 0) {
   reqStr.append("If-Modified-Since:" +
HttpDateFormat.toString(datum.getFetchTime());
   reqStr.append("\r\n");
}

-- 
http://www.linkedin.com/in/paultomblin