Skip to content

Instantly share code, notes, and snippets.

@marcelduran
Created June 26, 2014 04:14
Show Gist options
  • Save marcelduran/b86092dff355763cccd2 to your computer and use it in GitHub Desktop.
Save marcelduran/b86092dff355763cccd2 to your computer and use it in GitHub Desktop.
defer.me
require('http').createServer(function(req,res){
console.log(req.headers['user-agent']);
res.writeHead(200, {
'Content-Type': 'text/css',
//'Cache-Control': 'private, max-age=' + 60*60*24*365*10,
//'Expires': new Date(new Date().getTime()+(1000*60*60*24*365*10)).toUTCString(),
'Vary': 'Accept-Encoding'
});
/*res.end(); return;*/
var d = new Date();
while(new Date() - d < 5000){}
res.end(require('fs').readFileSync('foo.css'))
}).listen(8888);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment