Open Bug 2097593 Opened 3 days ago Updated 3 days ago

Speculation rules prefetch makes slow-streaming pages load later than with prefetch disabled

Categories

(Core :: DOM: Networking, defect, P2)

defect

Tracking

()

People

(Reporter: smayya, Assigned: smayya)

References

(Blocks 1 open bug)

Details

(Keywords: perf, Whiteboard: [necko-triaged])

Attachments

(1 external file)

When a navigation matches a speculation rules prefetch that is still in flight, Firefox holds the navigation until the prefetch has received its entire response body, not just its response headers. For pages whose server sends headers quickly but streams the body slowly, the navigation commits later than it would with prefetch disabled. If the body takes longer than dom.speculation_rules.wait_timeout_ms (2 s), the wait times out and the page is fetched again from the network.

In this bug, we should decide if we should simply increase the time out (based on eagerness) or modify our behavior where we start serving the document once we receive the headers. Not sure how complicated the later part is.

Assignee: nobody → smayya

A non-immediate prefetch starts only shortly before its navigation, on hover
or pointerdown, so the navigation usually finds it still in flight. With a
single 2 s wait, a slow prefetch was given up on and the page fetched again,
throwing away the prefetch's head start.

Replace dom.speculation_rules.wait_timeout_ms with
dom.speculation_rules.wait_timeout_immediate_ms (2 s) and
dom.speculation_rules.wait_timeout_non_immediate_ms (20 s), and pick the
longer one when a non-immediate prefetch could match the navigation. The
values are to be tuned in bug 2080290.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: