title: Express.js + HTML5 appcache not working in Firefox
body: <p>I want to use HTML5 app cache in my MEAN app but I can't make it work in Firefox 36. It works in Chromium as expected. This is my file structure:</p>
  
  <pre><code>client
      app.js
      manifest.appcache
      views/
          index.html
          about.html
  server.js
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html manifest="/manifest.appcache"&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;a href="views/about.html"&gt;About&lt;/a&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>manifest.appcache:</p>
  
  <pre><code>CACHE MANIFEST
  #0
  CACHE:
  views/about.html
  app.js
  </code></pre>
  
  <p>server.js:</p>
  
  <pre><code>var http = require("http");
  var express = require("express");
  var app = express();
  
  app.get("/manifest.appcache", function (req, res) {
      res.set("Content-Type", "text/cache-manifest");
      res.set("Cache-Control", "no-store, no-cache");
      res.set("Expires", "-1");
      res.sendFile("/client/manifest.appcache", {root: __dirname});
  });
  app.get('/', function (req, res) {
      res.sendFile('/client/views/index.html', {root: __dirname});
  });
  app.use(express.static(__dirname + '/client', { maxAge: 31557600000 }));
  app.listen(8080);
  </code></pre>
  
  <p>When I go to localhost:8080, Firefox successfully fetches the manifest (which is not visible in the network tab of dev tools) but it does not store the files in the app cache (Preferences - Advanced - Network shows 0 bytes). It loads them from the standard system cache (I get 304).</p>
  
  <p>I suspect that my routing somehow breaks the links in manifest.appcache but I had to prevent the manifest to be cached itself. I'm not an expert on Node.js and I'm confused by the fact that Chromium and Firefox behave differently. Any help will be appreciated.</p>