DEV Community

Discussion on: Help speeding up website / Mobile View

Collapse
 
pavelloz profile image
Paweł Kowalski

In markdown you do ordered lists by writing 1. my point :)

  1. GTM is much more than GA, GA should be lighter and faster. GTM allows you to inject any arbitrary js code into your page and do some other very bad things in regards to performance.

I would probably switch to async loaded GA.

  1. In general if you move everything at the end of body and there is no WEIRD js, nothing should change apart from that something will appear on the screen, before js is executed.

I see that you fixed js errors, so at least the order is now correct.

You can do it step by step. Move js to the end of head (after everything).
Next step, move last script from head, to the end of the body. One by one, sooner or later this layout thing should break, and you will at least know which script exactly is breaking.

I would also move mailchimp script to the end of body, just to keep it all together.

TBH i would remove mailchimp script altogether, as it is loading second jquery (1.9.0) inside of it. so i would probably cut out whats needed from there and self-host it.

My personal web performance rules:

  1. As little as possible
  2. Load blocking things last
  3. Lazyload whatever your users dont need ASAP
Thread Thread
 
pavelloz profile image
Paweł Kowalski • Edited

Ouh, and someone else in comments noticed something important, it looks like cache headers are weird in most assets:

cache-control: public, max-age=0, must-revalidate

This kind of sucks because browser cannot cache those assets even if they didnt change, so subsequent page views are not benefiting from browser cache.

Thread Thread
 
johanneslichtenberger profile image
Johannes Lichtenberger

Oh, this must be a Jekyll setting somewhere, maybe :(

Thread Thread
 
johanneslichtenberger profile image
Johannes Lichtenberger

It was Netlify, which adds this Header... I had to use a Jekyll plugin:

github.com/jgarber623/jekyll-netli...