Menu

Compress Images Before You Upload: A Faster Website Workflow
📰

Compress Images Before You Upload: A Faster Website Workflow

DEV Community: beginners·Jay Barker·10 days ago
#lTznMxMo
#devtobeginners#devto#dev#webp#size
Reading 0:00
15s threshold

You run Lighthouse on a page you just shipped, and there it is again, right at the top of the report: "Properly size images." Underneath, a list of offenders, led by a 4.2 MB hero photo that someone exported straight from a camera and dropped into the CMS.

Images are usually the heaviest thing on a web page, and they're often the Largest Contentful Paint element too, which means they directly affect how fast your page feels and how it scores in Core Web Vitals. The fix isn't complicated, but it does need a consistent workflow, because "remember to compress it" is not a process.

So if you've been searching for how to compress images for a website properly, this is the workflow I use. It's six steps, a short script that does most of it in one command, and the HTML to serve the results the right way.

Disclosure: Jay Barker writes for SEO Site Checker, whose image compressor is mentioned below.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.