title: Node/Express serving image if exist; Caching issue
body: <p>been using SO for a while but it's my first question here, as I couldn't find a solution for this particular problem. I'll try to be as explicit as possible, is anything is unclear just let me know so I update the question accordingly.</p>
  
  <p>I'm using a route to serve a user's photo according to the userId passed in the route as parameter (). It works, but each time the tag is encountered it request the image from the server and never uses a cached version.</p>
  
  <p>I played with Cache-Control a bit, but it's either all or nothing: If caching is enabled and the user change his photo, it will still use the old photo.</p>
  
  <p>My question is: is it possible to use a cached version if the photo hasn't changed, but if it did use the one from the server? I tried using "must-revalidate" along with "max-age" or "no-cache" to no avail.</p>
  
  <p>Here's the route code if it helps:</p>
  
  <pre><code>Module.exports.getPhoto = function(req, res) {
      var mime = require('mime-magic'),
          memberId = req.params.memberId,
          imgUrl;
  
      path.exists('public/images/memberPhotos/' + memberId, function(exists) {
          if(exists) {
              imgUrl = 'public/images/memberPhotos/' + memberId;
          }else{
              imgUrl = 'public/images/memberPhotos/noPhoto.jpg';
          }
  
          fs.readFile(imgUrl, function(err, img) {
              mime.fileWrapper(imgUrl, function(err, mimeType) {
                  if(!err) {
                      console.log(mimeType);
                      res.writeHead(200, {
                          'Content-Type': mimeType,
                          'Cache-Control': "max-age=" + 43800*60 + ", must-revalidate"
                      });
                      res.end(img, 'binary'); 
                  }
              });
  
          });
      });
  };
  </code></pre>
  
  <p>Thanks</p>