Forgive me if I'm missing something blindingly obvious, but say I use a minimum example like this:
var express = require('express');
var app = express.createServer();
app.configure(function() {
app.use(express.static(__dirname, { maxAge: 31557600000 }));
});
app.listen(3000);
... and then I invoke it like this:
NODE_ENV=production node app.js
And then I load it up like this:
I would expect that when reloading the file I'd get a 304 status instead of 200. The cache-control, last-modified, and etag headers are present in the response, and look reasonable to me, but the browser refuses to send an if-modified-since request header.
Am I missing something?
Thanks,
-Dan
What does <http://redbot.org/> say about the URL?
Cheers,
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
--
Mark Nottingham http://www.mnot.net/
Beware the way you refresh. How and with what browser?
> Can you paste in a copy of the response?
GET /test.js HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Length: 241
Cache-Control: public, max-age=31557600
Last-Modified: Mon, 22 Aug 2011 12:00:37 GMT
Etag: "241-1314014437000"
Content-Type: application/javascript
Accept-Ranges: bytes
Connection: keep-alive
> What does <http://redbot.org/> say about the URL?
It says it needs a Date header -- "Responses without a Date aren't allowed to have Expires or Last-Modified values."
Thanks,
-Dan
res.setHeader('Date', new Date().toString());