-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Suggestion: consolidate all CSS files into one file #37
Comments
What's the advantage compared to caching the individual css files? |
For a browser, loading one file of size X is much more efficient than loading two files of size X/2. If you have two different loader types on one page, instead of loading two files you'll only load one. And if I have one app that uses loader type 1, and later I go to a different app that uses loader type 2, the browser would already have the file cached if they're in the same file. Reducing the number of file requests is a very common technique in web development to make loading time much more efficient, even if the single file is larger. Shiny itself also uses a similar technique, for example in the source code there are individual JS files for each input type, but they all get concatenated together into one file when used in shiny apps. It's also similar to the concept of CSS sprite maps. |
I was working under the assumption that most people use 1 (at most 2) different spinner styles in any given project, in which case the separate files are probably more efficient ;) But I don't want to nitpick, I am also perfectly fine with a single file, it's tiny amount of code anyways. |
Oh I absolutely agree that 90+% of uses are with the default type! This
would just simplify the code and if there were 100 types then there'f be a
difference in downloading the file, but currently the file would be so
small that it wouldn't take any longer to download.
I was going to say the same thing as your last sentence :) I'll leave this
open for now until I resolve the CRAN issues and return from vacation, you
as the original author shall have the last word.
…On Wed., Jan. 15, 2020, 00:31 andrewsali, ***@***.***> wrote:
I was working under the assumption that most people use 1 (at most 2)
different spinner styles in any given project, in which case the separate
files are probably more efficient ;)
But I don't want to nitpick, I am also perfectly fine with a single file,
it's tiny amount of code anyways.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHIQFH4SGRX56PVEZ7HJETQ52NRJANCNFSM4KF3UQGA>
.
|
Right now there's one css file per spinner type, plus a fallback css. There's no technical reason that they can't all be included in one file, and then the browser would be able to cache this one. The downside is that the file will be larger, but it's still tiny and negligible.
The text was updated successfully, but these errors were encountered: