Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

CSS is being loaded twice #324

Closed
dy opened this issue Sep 29, 2020 · 3 comments
Closed

CSS is being loaded twice #324

dy opened this issue Sep 29, 2020 · 3 comments

Comments

@dy
Copy link

dy commented Sep 29, 2020

Due to this condition, CSS is loaded twice in Safari. There should come else before this statement.

ss.onloadcssdefined = onloadcssdefined;

@tylersalminen
Copy link

I actually am having this issue in chrome but not firefox. Believe the issue is with how the browser handles changes in the media / rel / etc. attributes on the element. In this case, whenever the value of media is changed the css assets is re-downloaded, i.e. on the initial set to media="only x" then again when media="all". You can test this yourself by flipping the media attribute with a button manually and see in the network tab that the asset will be re-downloaded. I only noticed this happening recently in chrome and again this does not occur in firefox which leads me to believe it's a browser behavior issue.

@blq
Copy link

blq commented Apr 26, 2021

Can confirm this happens in Chrome 90 too.
(tried with both "only x" and "print" as pre-load media type)

@CramericaIndustries
Copy link

Had the same issue, same file was downloaded 3 times. Turned out that in Chrome dev tools I had the "Disable Cache" checkbox checked. After I unchecked it and reloaded the page the file was downloaded only once.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants