Skip to content

Commit

Permalink
Merge pull request #22 from tomvit/master
Browse files Browse the repository at this point in the history
Last-Modified header
  • Loading branch information
felixge committed Aug 15, 2011
2 parents 591d5c1 + bcaf4f0 commit 70e2c16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/paperboy.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ exports.streamFile = function (filepath, headerFields, stat, res, req, emitter)

var etag = '"' + stat.ino + '-' + stat.size + '-' + Date.parse(stat.mtime) +'"';
headerFields['ETag'] = etag;

// last-modified date should be present along with etag
// also in a client-side JavaScript, document.lastModified uses this header value
headerFields['Last-Modified'] = new Date(stat.mtime);

var statCode;
//Check to see if we can send a 304 and skip the send
Expand Down

0 comments on commit 70e2c16

Please sign in to comment.