Last active
April 8, 2018 01:54
-
-
Save bradvogel/16fb24eb444dfafc8fa4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Run this by downloading this script to your computer, then: | |
* 1. $ npm install express | |
* 2. $ node thisscript.js | |
* 3. Open localhost:8030/nocache and then localhost:8030/nostore | |
*/ | |
var app = require('express')(); | |
app.get('/nocache', function(req, res) { | |
res.setHeader('Cache-Control', 'no-cache'); | |
res.send(new Date().toString() + '<br><a href="https://mixmax.com">Click to navigate away and then press ' + | |
'Back. It will show the same timestamp.</a>'); | |
}); | |
app.get('/nostore', function(req, res) { | |
res.setHeader('Cache-Control', 'no-cache, no-store'); // Added no-store | |
res.send(new Date().toString() + '<br><a href="https://mixmax.com">Click to navigate away and then press ' + | |
'Back. It will update the timestamp.</a>'); | |
}); | |
app.listen('8030'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment