Compression should package your finished public website, not your whole working project. Create a dedicated publish folder first; it makes the archive smaller, safer, and easier to troubleshoot.

Build a publish folder

publish/
├── index.html
├── assets/
├── images/
└── favicon.ico

Copy only files the visitor’s browser needs. For a static-site generator, use its output directory. For a hand-built site, copy the HTML and referenced assets.

Do not include

  • .env, API keys, private notes, or database exports.
  • node_modules, source control folders, and editor settings.
  • Original multi-megabyte images when a web-sized WebP/AVIF exists.
  • Build source when the generated HTML/CSS/JS is what visitors need.

Verify before upload

  1. Open publish/index.html locally.
  2. Compress the contents of publish.
  3. Open the ZIP and make sure it starts with index.html.
  4. Upload and inspect the live URL in a private window.

A smaller ZIP uploads faster, but do not delete files merely to make it small. First identify unused files, optimize images, and let your build tool minify CSS and JavaScript.