Support HTTP 304 responses? #210

Closed
opened 2019-08-15 02:23:23 -05:00 by holloway · 0 comments
holloway commented 2019-08-15 02:23:23 -05:00 (Migrated from github.com)

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.

When reading the [Pjax distribution code](https://unpkg.com/browse/pjax@0.2.8/pjax.js) I found these lines of code... ```javascript 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#210