Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebDriver BiDi] Fix issue with cached JS in Chrome #49904

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lightning00Blade
Copy link
Contributor

It seem that Chrome sends only 1 request when the there are multiple scripts with the same URL, this look like optimization on our end.

Tested locally with HTML:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./console.js"></script>
    <script src="./console.js"></script>
  </head>
  <body></body>
</html>

And JS:

console.log(2);

@Lightning00Blade Lightning00Blade changed the title [WebDriver BiDi] Fix issue with cached JS [WebDriver BiDi] Fix issue with cached JS in Chrome Jan 3, 2025
@juliandescottes
Copy link
Contributor

For images I explicitly removed the cache tests because the spec doesn't guarantee that fetch will be used, if the image is already in the document's cached resources.

However for scripts I think the HTML spec guarantees that we should hit fetch for each script tag. Of course it can still then hit the cache and avoid the network layer, but I think we should still see a network event (with fromCache: true) for each tag.

At least that's what I understand when reading https://html.spec.whatwg.org/#script-processing-model:fetch-a-classic-script ?

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.

4 participants