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

Compress original screenshot images. #219

Closed
StevenDufresne opened this issue Oct 4, 2023 · 4 comments
Closed

Compress original screenshot images. #219

StevenDufresne opened this issue Oct 4, 2023 · 4 comments
Labels
[Component] Backend Anything wp-admin or PHP-related
Milestone

Comments

@StevenDufresne
Copy link
Collaborator

StevenDufresne commented Oct 4, 2023

JetPack is converting screenshots to WebP, greatly reducing image size but the original pngs should also be compressed. Can we run a script to compress the screenshots?

Take for example:

Screenshot 2023-10-04 at 12 15 53 PM

Site Link :https://wordpress.org/showcase-v2/opus-one/

Current
Media library .png is 4mb.
Outputted .webp is 1.2mb

I compressed that image and was able to cut size by ~60% with negligible visible difference.

Media library .png is 1.8mb.
Outputted .webp is 482kb.

Page load improved by ~400ms (on my connection) by making an update to this one image. On single pages, there are 4 of these images.

@StevenDufresne
Copy link
Collaborator Author

This also relates to: #175 (comment)

@ryelle
Copy link
Contributor

ryelle commented Oct 4, 2023

When I updated the "how to screenshot" wiki I added a note about using something like ImageOptim. Ideally this would be done on upload — but now we have many uploaded images already, so a script to update them would be nice, especially with that much improvement.

The script would also need to update each site though, because once CDN'd, the image would not be re-synced.

No cache invalidations. Currently, static assets are tied to the public version of WordPress, Jetpack, or WooCommerce that you’re using. For images, if you want to “refresh” an image, you will need to change its file name. Adding random query arguments, commonly known as “cache busters,” will not work.
source

So for every site: get the desktop & mobile image, optimize it, reupload it to the media library, and update the screenshot meta fields with the new attachment ID.

Not impossible, but could be tricky.

@ryelle ryelle added the [Component] Backend Anything wp-admin or PHP-related label Oct 4, 2023
@ryelle ryelle added this to the Future milestone Oct 4, 2023
@adamwoodnz adamwoodnz modified the milestones: Future, Launch Oct 8, 2023
@pkevan
Copy link

pkevan commented Oct 9, 2023

When I look at the site, images are run through Jetpack photon and have reasonable sizes (~500kb instead of 4mb). Did something change, or get updated?

@StevenDufresne
Copy link
Collaborator Author

I agree. This appears to be resolved. Not sure why. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Backend Anything wp-admin or PHP-related
Projects
None yet
Development

No branches or pull requests

4 participants