forked from youtube/spfjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow advanced users to enforce JSON response types in XHRs.
Add support for setting the XHR `responseType` property to `"json"`. This defines the response data as JSON and prevents the browser from handling other types of data. It allows JSON parsing to be done off of the main thread, reducing CPU contention that can happen with large responses and low-power devices; this can yield smoother animations during navigation, for example. However, it prevents processing chunked responses on-the-fly (i.e. pseudo-streaming), effectively eliminating most of the benefits of multipart responses. Guard this behavior behind an "advanced" config flag and provide no default to prevent accidental usage. Setting `advanced-response-type-json` to `true` will enable the feature. Closes youtube#317.
- Loading branch information
Showing
3 changed files
with
220 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.