I have tried all the possibilities. Following are my response headers
HTTP/1.1 200 OK
Expires: Sun, 20 Dec 2015 03:53:42 GMT
Accept-Ranges: bytes
Cache-Control: public, max-age=604800
Last-Modified: Wed, 02 Dec 2015 15:49:21 GMT
Etag: W/"25571-15163623fb3"
Content-Type: image/png
Content-Length: 152945
Date: Sun, 13 Dec 2015 03:53:42 GMT
Connection: keep-alive
But still it's not returning 304 status. If I refresh command refresh in Firefox it's downloading that image again with 200 response code. I don't want that if user click command refresh it's should return 304 status. instead of downloading new file it should take it from browser cache.
Following is my nodejs code
var expireTime = 604800000;
app.all('/css*', function(req, res, next) {
res.header('Expires', new Date(Date.now() + expireTime).toUTCString());
next();
});
app.use('/css',express.static(conf.nodePath + 'css',{ maxAge: expireTime}));
Can anyone guide me how to enable perfect cache. Thanks in advance..