Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

check for no-cache cache request directive

  • Loading branch information...
commit 3e48f299d574d8663483b9eb59998ae694655431 1 parent 6e48234
@paulwalker paulwalker authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 index.js
View
4 index.js
@@ -28,10 +28,14 @@ function fresh(req, res) {
var noneMatch = req['if-none-match'];
var lastModified = res['last-modified'];
var etag = res['etag'];
+ var cacheControl = req['cache-control'];
// unconditional request
if (!modifiedSince && !noneMatch) return false;
+ // check for no-cache cache request directive
+ if (cacheControl && cacheControl.indexOf('no-cache') !== -1) return false;
+
// parse if-none-match
if (noneMatch) noneMatch = noneMatch.split(/ *, */);
Please sign in to comment.
Something went wrong with that request. Please try again.