| 217 | /*Routing function implementations*/ |
| 218 | |
| 219 | var setupAjaxCaching = app => // IE/Edge are more aggressive about caching than other browsers, so we'll override their caching here. |
| 220 | // Assumes our CDN will override these with its own caching rules. |
| 221 | app.get('/db/*', function(req, res, next) { |
| 222 | if (!req.xhr) { return next(); } |
| 223 | // http://stackoverflow.com/questions/19999388/check-if-user-is-using-ie-with-jquery |
| 224 | const userAgent = req.header('User-Agent') || ""; |
| 225 | if ((userAgent.indexOf('MSIE ') > 0) || !!userAgent.match(/Trident.*rv\:11\.|Edge\/\d+/)) { |
| 226 | res.header('Cache-Control', 'no-cache, no-store, must-revalidate'); |
| 227 | res.header('Pragma', 'no-cache'); |
| 228 | res.header('Expires', 0); |
| 229 | } |
| 230 | return next(); |
| 231 | }); |
| 232 | |
| 233 | var setupJavascript404s = function(app) { |
| 234 | app.get('/javascripts/*', (req, res) => res.status(404).send('Not found')); |