Closed Bug 1694134 Opened 3 years ago Closed 3 years ago

Double request for link header preloaded JS and CSS assets

Categories

(DevTools :: Netmonitor, defect)

Firefox 85
Unspecified
Windows 7
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1694202

People

(Reporter: ioannis.cherouvim, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36

Steps to reproduce:

My website sends the following HTTP response header:

Link: </static/js/main.js>; rel=preload; as=script

And within the HTML, just before the body close, I have this:

<script src="/static/js/main.js"></script>

This causes the script to be loaded twice (in Firefox 85), consuming twice the bandwidth.

I also confirm that by setting network.preload to false in about:config I only get 1 request instead of 2.

Is there a solution to this? I obviously want to preload and only get 1 request. Chrome doesn't have this problem.

This problem is also reproducible right now on these sites (which attempt to preload JS and CSS):

Actual results:

The asset is loaded twice, consuming twice the bandwidth.

Expected results:

The asset to be loaded once.

The Bugbug bot thinks this bug should belong to the 'DevTools::Netmonitor' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Netmonitor
Product: Firefox → DevTools
OS: Unspecified → Windows 7

Also happens on Firefox 86.

Hi ioannis,
Thanks for reporting!

A related issue was recently fixed. See Bug 1694202 for details. The fix should be in the latest nightly
Can you test on Firefox Nightly to see if you still see the issue?

Thanks

Flags: needinfo?(ioannis.cherouvim)

I confirm the fix with nightly for:

  • js files.
  • css files.
  • woff2 files which had anonymous instead of anonymous="crossorigin".

Thanks!

Flags: needinfo?(ioannis.cherouvim)

Thanks alot ioannis.

Closing this.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.