2

I'm wondering that why Inspector shows duplicate CSS as follows: enter image description here

What is the difference between Cause column: stylesheet vs JS stylesheet?

UPDATE: Here some explanation. Seems like my css is actually included twice if js request for it too?

https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor#Cause_column

UPDATE:

enter image description here

Now there's even more - 4x same css.

  • I notice you haven't included the left hand column - if you did we would see two different statuses one is 302 (found) and the other is 200 (OK), it looks like it is not actually loading it twice, just giving a running commentary on what is being loaded – Steve May 12 '17 at 11:30
  • Added another image. – user1271930 May 12 '17 at 11:44
  • Can you tell us more about how and why you think your JavaScript is requesting this CSS be added a second time? It sounds like that would be your issue, but I don't know what your use case is of having JavaScript load CSS. – Stephen Ostermiller Jul 17 '17 at 17:15
1

Yes, it appears as though you may be linked to the CSS through a page that is also linked to another file (JS?) that is also linked to that same CSS. I can't be certain, but that's what it looks like. My guess is that if you comment out the CSS linkage in the JS file, your site will operate the same as before, but without loading the CSS more than once. Where that may fall apart is if you have the JS file being used, elsewhere...where the CSS hasn't yet been called.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.