Skip to content

Commit

Permalink
added Last-Modified header
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvit committed Aug 13, 2011
1 parent 591d5c1 commit bcaf4f0
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 bcaf4f0

Please sign in to comment.