MoOx / pjax

Easily enable fast Ajax navigation on any website (using pushState + xhr)
MIT License
1.43k stars 124 forks source link

Support HTTP 304 responses? #210

Open holloway opened 5 years ago

holloway commented 5 years ago

When reading the Pjax distribution code I found these lines of code...

  request.onreadystatechange = function() {
        if (request.readyState === 4) {
          if (request.status === 200) {
            callback(request.responseText, request, location, options);
          } else if (request.status !== 0) {
            callback(null, request, location, options);
          }
        }
      };

Should it also handle HTTP 304?

304 Not Modified This is used for caching purposes. It tells the client that the response has not been modified, so the client can continue to use the same cached version of the response.