gbif / hp-beaty-biodiversity-museum

This repository is for the GBIF Hosted Portal for the Beaty Biodiversity Museum
https://collections.beatymuseum.ubc.ca
Apache License 2.0
1 stars 3 forks source link

Improve site homepage load time through http 400 fix and image size reduction #55

Closed mpitblado closed 11 months ago

mpitblado commented 11 months ago

Currently in production there is a http 400 error when trying to GET https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600;0,800;1,800&display=swap. This is my error in the implementation of the font, and the following calls within the head.html head can just be removed

<link
  href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600;0,800;1,800&display=swap"
  rel="stylesheet"
/>

<style>
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,800;1,400;1,600;1,800&display=swap');
</style>

The hero image is transferring at 383.8 kB, and isn't appearing until 1.9s, as shown by a site test from Montreal below. Going to try to reduce the size of this image a bit, (75% of current quality), to try to get the time to appearance down. I believe the build process handles some of the compression, however sending a lower quality image in the code should result in a lower size at the end of the build process.

image

image

mpitblado commented 11 months ago

It seems that resolving the http 400 error has shaved 0.4s off of the total load time, and bumped the Google pagespeed score from 75 to 97.