Skip to content

WIP: Preload browser differences (for discussion, not for merging) - #30981

Closed
noamr wants to merge 5 commits into
masterfrom
preload-entropy
Closed

noamr wants to merge 5 commits into
masterfrom
preload-entropy

Conversation

@noamr

@noamr noamr commented Sep 27, 2021

Copy link
Copy Markdown
Contributor

This test is meant to support the discussion in
whatwg/fetch#590.

The test accesses a URL that returns an integer that gets incremented
with each request (starting with 0).

The test preloads it once, and then loads it twice.

In Firefox, the test returns 0,0
In Chrome, the test returns 0,1 (preload is used for one request)
In Safari, the test returns 1,2 (preload makes an unused request)

This test is meant to support the discussion in
whatwg/fetch#590.

The test accesses a URL that returns an integer that gets incremented
with each request (starting with 0).

The test preloads it once, and then loads it twice.

In Firefox, the test returns 0,0
In Chrome, the test returns 0,1 (preload is used for one request)
In Safari, the test returns 1,2 (preload makes an unused request)
@noamr noamr changed the title WIP: Preload entropy (for discussion, not for merging) WIP: Preload browser differences (for discussion, not for merging) Sep 27, 2021
Comment thread preload/preload-edge-cases.html Outdated
const serveUrl = './resources/inc.py'
function uuidv4() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://wicg.github.io/uuid/ could've been interesting here, but I don't think it's broadly supported.

@noamr

noamr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

I updated the test cases to also include script and image loading, and to try several combinations of cache headers from the server (can possibly add more).
Also I'm separating the count from the response content, to make it easier to add new resource types in the future.

^^ @pmeenan

@noamr noamr closed this Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants