Website page load help - minifying javascript & css

Discussion in 'HTML & Website Design' started by faizzsheikh, Jun 7, 2016.

  1. #1
    Hi...

    We have made a new website in wordpress using a theme, when we check the Google speed test there are approx 32 javascripts rendering, i.e 32 HTTP requests which is too much. Is there a way I can combine all into one or ZIP them to one so that with one HTTP request it could render all the scripts?
     
    faizzsheikh, Jun 7, 2016 IP
  2. malky66

    malky66 Acclaimed Member

    Messages:
    3,997
    Likes Received:
    2,248
    Best Answers:
    88
    Trophy Points:
    515
    #2
    WHAT??? 32 javascript files???....Welcome to turdpress and all it's pointless bloatiness:)
    Basically there is nothing you can do but take it outside and shoot it, Put it out of it's misery.
     
    malky66, Jun 7, 2016 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    The problem is that all the plugins and themes in WordPress load their own scripts. This is a problem which is hard to mitigate without rewriting plugins / core functions.
     
    PoPSiCLe, Jun 7, 2016 IP
    deathshadow likes this.
  4. raajtram

    raajtram Member

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #4
    Use the W3 Total Cache Plugin - it helps you minify many JS files into one combined file, and hence reducing the number of HTTP requests by a significant amount.
     
    raajtram, Jun 7, 2016 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Welcome to why I say turdpress has no business being used for business.

    There are tricks -- like the one @raajtram mentioned -- that can reduce it, and you could combine the scripts manually as well, but if there's that much scripting "needed" for the page in the first place, there's something horrifyingly and disastrously wrong with the page.

    Hence @malky66's reaction... and I guess @PoPSiCLe said it too -- both doing so WAY more politely than I normally would.

    There is just so much asshat BS that goes with a turdpress template, that I can't fathom how most people have the patience or are willing to put so much effort into dealing with it. I mean, take the infographics site in your siggy -- (which is blogger, not turdpress -- same difference, crappy off the shelf solution) -- endless static style in the markup (100% of the time someone uses <style> they're doing something wrong), <style> inside <body> where it's completely invalid, clearing DIV like it's still 1998, massive static scripting in the markup, endless pointless "JS for nothing" rubbish, absolute URI's wasting bandwidth for *** knows what, little if anything resembling logical document structure or semantic markup, endless pointless idiotic mouth-breathing dumbass ignorant halfwit use of classes...

    That's how one ends up with 71k of markup to deliver 5.5k of plaintext and less than a dozen content images -- basically ten to twelve K of HTML's job!

    Basically, everything one can expect from a any of these "one size shits all" solutions. If you care at all about speed, accessibility, functionality, and code sanity, no off the shelf solution is going to provide it... and things like W3 Total Cache is just "throwing more code" at the problem instead of fixing the actual cause... the garbage nonsense 99.99% of turdpress templates have the unmitigated gall to call code.
     
    deathshadow, Jun 7, 2016 IP
    malky66 likes this.