• Resolved joedarko

    (@joedarko)


    Hi,

    i love the plugin and i would like to ask one quick question about best practices when it comes to website loading speed.

    Is it OK when i separately add many different custom CSS codes or could it be slowing my website down because it has to load everything separately and i should rather put all the code into one part?
    _____________________________________

    How i do it now:

    Custom CSS 1 (Some code inside)
    Custom CSS 2 (Some code inside)
    Custom CSS 3 (Some code inside)
    .
    .
    .
    Custom CSS 25 (Some code inside)
    _____________________________________

    Would it be better like this?

    Custom CSS 1 (All the code inside)
    _____________________________________

    Yeah, so i would just like to know if adding all my code as one custom CSS addition will have any benefit in terms of loading speed than adding my custom CSS codes as many separate additions.

    Thank you very much for your answer. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    Hi,

    of course the number of loaded files has an impact on the page load speed, but it’s all a matter of balancing code maintainability with page speed.

    You can also put everything into one CSS Custom code; the page will load fast, but if it’s too long, then it might be hard to maintain/modify the CSS code later when you want to change something.

    If you add several inline CSS codes, then the page will still load fast, but then the browser will not be able to cache the CSS codes and load them from the cache on the next page load.

    If you add several external CSS codes, the browser will need to load each of them, which will add several microseconds to the load speed, but then the browser caches the files.

    Definitely it isn’t recommendable to write make a new CSS Custom Code for each CSS rule. But splitting the code in several CSS Custom Codes in a logical manner will keep the code more maintainable.

    I personally split the code by functionality. For example I would have a CSS Custom Code for implementing an FAQ section, another to modify the output of a plugin and yet another for modifying a bit the theme.

    I hope this answers your question.

    Thread Starter joedarko

    (@joedarko)

    Great, thank you very much for the detailed answer!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Speed optimization question’ is closed to new replies.