CSS and JS calls

Support General CSS and JS calls

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29330
    Nicholas CoxNicholas Cox
    Participant

    Hi

    I have included Metabox using composer and I have only enabled the addons which I need and from viewing my website calls I can see that there is alot of separate JS and CSS calls being made by Metabox. Not to say there is nothing wrong with this, I just wanted to know how I can combine all of these CSS and JS calls to reduce the number of calls?

    I am optimising my site and performed a test with no Metabox front end form and found my site loads in 1.1s. But with a Metabox form on it loads in 2.3 seconds. I would like to optimise my site to the maximum so that's why I'm asking. I ideally want to not want to use a 3rd party plugin.

    oIaDUN.jpg

    #29338
    Long NguyenLong Nguyen
    Moderator

    Hi Nicholas,

    I recommend using a third-party plugin such as Autoptimize, WP Rocket to combine CSS, JS into one file. It's very complicated to create your own function and start from scratch.

    #29339
    Nicholas CoxNicholas Cox
    Participant

    Hi

    Ok thanks, I'll check them out, in regards to the scripts, are the required scripts only being called for the forms? or do you load all scripts regardless of if the form requires it or not?

    Thanks

    Nick

    #29345
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Yes, only the necessary CSS, JS files are loaded along with the form and the required field. You can check on the page without the form or remove some fields to see the script files loaded.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.