title: Prevent Getting Json Response from Cache in Express JS
body: <p>I'm using Express and Node to build a web, where the client uses RESTful API to get Json response to show a list of objects. </p>
  
  <p>After creating a new object, the app should request a new json response of the updated object list. Chrome works fine - new json response returned with status code 200 OK. However, things are not good in IE and Edge - it seems the browser just fetch the json response from cache (with status code 304), instead of making a new request. If I manually clear the browser cache data things will be fine.</p>
  
  <p>I tried this solution: <a href="https://stackoverflow.com/questions/25462717/cache-control-for-dynamic-data-express-js">using a middleware to set max-age of cache-control res.header to be 0</a></p>
  
  <pre><code>function headerSet(req, res, next) {
    res.header('Cache-Control', 'public, max-age=0');
    return next();
  }
  </code></pre>
  
  <p>And in the response header I can see accordant settings taking effect, however, IE and Edge still refuse to make a new request - I'm still getting the unupdated json response with 304.</p>
  
  <p>What possibly have I done wrong?</p>