X Tutup
Skip to content

perf(http): provide means to optimize response parsing #2609

@jeffbcross

Description

@jeffbcross

Right now, the Response object lazily parses the response body, based on what "getter" method is called: json(), text(), etc. The json method will attempt to parse the body at the time the method is called, which can be expensive for large requests. By allowing the response type to be declared ahead of time, XMLHttpRequest can perform the parsing on a separate thread before firing the load event.

Supporting this would be easy, but some thought should be given to how this should affect the existing fetch-response-like "getters" design, and how that design may encourage less-performant behavior.

CC: @IgorMinar

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup