[bug]: Large images on the main (landing) website
altrusl opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
I haven't found a repo for your main websitу (hoppscotch.com) so leaving it here
Current behavior
When users opens https://hoppscotch.com/blog or other pages on that subdomain they see images of enormous dimension and file size
For example: https://hoppscotch.com/images/blog-hoppscotch-wrapped-2023.png takes 8.53Mb
Its loading time is huge both for desktop and for mobile clients
Expected behavior
Proper image format (webp), dimension and file size
Steps to reproduce
- Go to https://hoppscotch.com/blog
- Check out image sizes
Environment
Production
Version
Cloud
Thanks for bringing this up.
I've added a build step to compress and optimize all image assets (png, jpeg, gif, tiff, webp, avif) using Sharp.js and SVG assets using SVGO.
Here's the output:
![Screenshot 2024-03-30 at 12 53 04 PM](https://private-user-images.githubusercontent.com/10395817/318176481-2d26b5e7-4542-4657-9e5b-77aa4318ce76.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQ4NTk0NDgsIm5iZiI6MTcxNDg1OTE0OCwicGF0aCI6Ii8xMDM5NTgxNy8zMTgxNzY0ODEtMmQyNmI1ZTctNDU0Mi00NjU3LTllNWItNzdhYTQzMThjZTc2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTA0VDIxNDU0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEzMjY4MTg4MjAxZjJjMTI3YjEzNzQ2MDcwNDdkYzFhNjU1MTlmZmY4MDRkY2Y1YjQyNzkxYzI4Zjk5NjJiMmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.dW4ncY-ja4jOZ5XLoBlErzygFM0CAVGxvLB3Turpobc)
We'll see if we can optimize assets further. Since the initial changes are in production, I'll close this issue for now. Let us know if you find any other issues with the Hoppscotch platform.