Skip to content

Instantly share code, notes, and snippets.

@adammw
Created August 11, 2011 07:54
Show Gist options
  • Select an option

  • Save adammw/1139129 to your computer and use it in GitHub Desktop.

Select an option

Save adammw/1139129 to your computer and use it in GitHub Desktop.
IE9 302 Redirect Caching Test
#!/usr/bin/env node
var http = require('http');
var state = 1;
http.createServer(function(req, res) {
if (req.url == '/redirme') res.writeHead(302, {'Location':'/redir' + state});
if (req.url == '/cacheme') res.writeHead(302, {'Location':'/redir' + state, 'Cache-Control': 'max-age=120'});
if (req.url == '/changestate') state++;
res.end('redir state: ' + state);
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment