-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Css loaded more than once when using custom combo loader #533
Comments
Perhaps you need to re-create YUI instance by call |
Can you explain more how that could be done? It is odd that this only occurs if I set a |
hm.. When set |
It's loading it more than once on the fiddle because it encountered an error. It's not a 200 response, so it attempts again to get it. |
@davglass Hmm. When running on my local server using my own comboLoader, even though it receives the correct response (200), it still downloads the CSS 3 times. When I inspect the requests in Firebug, I can confirm that indeed, the response is sent correctly and a status code of 200 was used. |
After more investigation, I think I have found the source of the problem. The loader needs the correct content-type. In the case of CSS, it should be |
This is not a caveat, this is just good practice. It's also not |
Perhaps caveat wasn't the right word for this, but I would still like to see this noted in the docs for loader (to explain that multiple requests to the same css files is not a bug if the content-type is incorrect). This can potentially save quite a lot of time (I actually spent a fair bit of today trying to find out why this is happening) for people using custom combo loaders. |
I'll gladly accept a pull request for the docs, but I feel it's more |
Here's a simple repo ( http://jsfiddle.net/tPFTX/ ):
If I run this, notice that the css for
widget-base
andcssbutton
is downloaded once.However, if I now set my own
comboBase
: http://jsfiddle.net/JYdPB/We see that the css for
widget-base
andcssbutton
is downloaded multiple times:The text was updated successfully, but these errors were encountered: