Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce image sizes to improve performance #20

Closed
blahosyl opened this issue Mar 10, 2024 · 6 comments
Closed

Reduce image sizes to improve performance #20

blahosyl opened this issue Mar 10, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@blahosyl
Copy link
Owner

Adding a higher resolution hero image lead to a drastic reduction of performance. Find a balance between a not too large file size and a good resolution.

@blahosyl blahosyl added the bug Something isn't working label Mar 10, 2024
@blahosyl blahosyl self-assigned this Mar 10, 2024
@blahosyl
Copy link
Owner Author

The biggest culprit might not be the hero image, but rather, the grayscale pictures in the Problems & Solutions section.
Try to make images grayscale (possibly also tinted?) with an external tool rather than with CSS.

@blahosyl
Copy link
Owner Author

Commit nr. d54d599671c34b8090b805ba893018c3779985da solved the performance issue caused by using CSS filter to create grayscale pictures (score back to 98%).

@blahosyl
Copy link
Owner Author

blahosyl commented Mar 10, 2024

Testing with a larger resolution hero image (commit) brought the score back down.

@blahosyl
Copy link
Owner Author

Created a 3rd, optimised sized image with TinyPNG. This works well on desktop, but not on mobile (score: 82).

I solved this by using the small image for mobiles and tablets, and the optimized one for desktops (commit).

This solved the issue, with a 96 Lighthouse score on mobile and 98 on desktop.

Further improvements suggested by Lighthouse involve eliminating the following from the page:

  • FontAwsome
  • Google Fonts
  • YouTube

However, these are integral parts of the content and design, so they will not be eliminated.

@blahosyl
Copy link
Owner Author

Mentor suggestion: use image set instead of media query – media query might load both images.

MDN Mozilla best site for explanation

@blahosyl blahosyl reopened this Mar 12, 2024
@blahosyl
Copy link
Owner Author

Mentor: performance is not an issue for this project

@blahosyl blahosyl transferred this issue from blahosyl/love-running Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant