title: How to cache views so files don't need to be re-read and re-rendered
body: <p>I have these view render calls:</p>
  
  <pre><code>router.get('/mcn', (req, res) =&gt; {
    res.render('product/mcn', { layout: 'product/layout', contactKey: 'mcn' });
  });
  
  router.get('/agency', (req, res) =&gt; {
    res.render('product/agency', { layout: 'product/layout', contactKey: 'agency' });
  });
  
  router.get('/esports', (req, res) =&gt; {
    res.render('product/esports', { layout: 'product/layout', contactKey: 'esports' });
  });
  
  router.get('/brand', (req, res) =&gt; {
    res.render('product/brand', { layout: 'product/layout', contactKey: 'brand' });
  });
  
  router.get('/analytics', (req, res) =&gt; {
    res.render('product/analytics', { layout: 'product/layout', contactKey: 'analytics' });
  });
  
  router.get('/rightsmanagement', (req, res) =&gt; {
    res.render('product/content-id', { layout: 'product/layout', contactKey: 'content-id' });
  });
  </code></pre>
  
  <p>as you may notice - there is no dynamic data being passed. So I am wondering how I can cache these views? Something like this:</p>
  
  <pre><code>const pug = require('pug');
  
   {
      const templateStr = fs.readFileSync(path.resolve(__dirname +'/../views/product/content-id'));
  
      const fn = pug.compile(templateStr, {});
  
      const html = fn({ layout: 'product/layout', contactKey: 'content-id' });
  
      router.get('/rightsmanagement', (req, res) =&gt; {
        res.send(html);
      });
  
    }
  </code></pre>
  
  <p>is that about right? I think I am missing some headers? doesn't anyone know what the right headers are?</p>