Set Last-Modified header to allow for 304 responses

This commit is contained in:
Sandro Santilli
2013-07-15 12:02:54 +02:00
parent 308246f324
commit afd4c3b460
2 changed files with 9 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
1.3.3
------
* Set Last-Modified header to allow for 304 responses
1.3.2
------
+8 -1
View File
@@ -215,10 +215,17 @@ module.exports = function(){
res.header('Cache-Control', 'public,max-age=31536000'); // 1 year
} else {
var ttl = global.environment.varnish.ttl || 86400;
res.header('Last-Modified', new Date().toUTCString());
res.header('Cache-Control', 'no-cache,max-age='+ttl+',must-revalidate, public');
}
// Set Last-Modified header
//
// Currently sets it to NOW
//
// TODO: find out a real value, querying for most recent change in
// any of the source tables
res.header('Last-Modified', new Date().toUTCString());
me.generateCacheChannel(req, function(err, channel){
if ( ! err ) {
res.header('X-Cache-Channel', channel);