Closed Bug 1618544 Opened 5 years ago Closed 5 years ago

[rel=preload] Let `XMLHttpRequest` use "fetch" preloads

Categories

(Core :: DOM: Networking, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: mayhemer, Assigned: mayhemer)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

Part of Design documentation for rel=preload

There are two main points to fulfill:

  1. At the place xhr opens its HTTP channel, look for an existing preload in Document.PreloadService using the key as defined in the design doc above. The "as" part of the key shall be "fetch". The exact content for the attributes part of the key is yet to be determined for xhr. If a prelaod is found in the PreloadService, then instead of opening a new channel, use the AsyncConsume method of the preload to get the data. If not, or if AsyncConsume fails, open a new HTTP channel as we do now.
  2. XMLHttpRequestMainThread has to implement PreloaderBase and after it opens its HTTP channel, register itself in Document.PreloadService so that later added <link preload> tags get the onload/onerror notifications and don't open a second channel.
    This goes against the finding on how Chrome behaves. A used fetch preload is removed from the preload hash table, following preloads create a new network request.
Priority: -- → P2
Whiteboard: [necko-triaged]
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Priority: P2 → P1
Blocks: 1638814
No longer blocks: 1638814
Pushed by honzab.moz@firemni.cz: https://hg.mozilla.org/integration/autoland/rev/bafe412a37ea Make XMLHttpRequest use <link preload>, r=baku
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: