Edge browser always uses 200 from cache when only etag is used.

  node.js, question

Use edge browser ajax to access a url and return a json string.
The server uses expressjs, the default setting, and only etag is added. The returned http header looks like this in the debugging tool inside.

The same url, under chrome, is like this

Supplement the appearance of Firefox

Then it is the result of js, console.log (xhr.getallresponseheaders ())
Under edge图片描述
Under chrome图片描述
Under Firefox图片描述

And request header looks like this.

It is not obvious that edge does not have the if-none-match item, because it insists on using 200 from cache, I can only delete cache to allow him to access the server, so edge is the first access.

The current situation is that I need to refresh the jsON string returned by this url through JS. chrome and Firefox are normal. If it is not changed, it is 304. If it is changed, it is 200 OK. However, edge must be 200 from cache. It can be seen that node does not receive any request from edge here. It uses cache directly. It is very annoying. Do you know any good solutions

The ajax code looks like this

const AjaxGet = function( method, url, callback ){
    var xhr = new XMLHttpRequest()
    xhr.open(method, url, true)
    xhr.withCredentials = true

    xhr.onreadystatechange = function(){
        if((xhr.readyState == XMLHttpRequest.DONE) && (xhr.status == 200)){

Ps. I don’t think it’s a good idea to disable etag, after all, it still needs 304

Clean up the lower cache, then access the same address in edge inside twice before and after without modifying the contents returned by the server, and then cut off a map. The information includes complete points, including at least:

  1. request header

  2. response header