Skip to content

perf(images): optimize high-traffic training assets - #2593

Open
carlospolop wants to merge 3 commits into
masterfrom
optimize/high-traffic-images
Open

perf(images): optimize high-traffic training assets#2593
carlospolop wants to merge 3 commits into
masterfrom
optimize/high-traffic-images

Conversation

@carlospolop

@carlospolop carlospolop commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

CloudFront logs attributed 13.371 GB (25.5% of a deduplicated two-day sample) to the 1,326,124-byte summer banner. The most frequent promotional images had no long-lived cache metadata.

Changes

  • Add versioned WebP assets and update the banner/discount references.
  • Summer image: 1,326,124 → 123,344 bytes (90.7% smaller); the sampled 13.371 GB would become ~1.244 GB at the same request count.
  • Certification badges: 99.3–99.6% smaller at 4× their 24px display height.
  • Publish only these versioned files with Cache-Control: public,max-age=31536000,immutable and Content-Type: image/webp.
  • Cover both English and translated deployments, including translation branches that do not yet contain the new theme/assets.
  • Keep all old PNG URLs to avoid breaking cached/older pages.

Validation

  • Visually compared PNG/WebP outputs; transparency, text, colors, and layout remain intact.
  • Upload helper exercised with a fake AWS CLI: four correct uploads per prefix.
  • Workflow YAML parsed; shell and JS syntax checks passed; git diff --check passed.

Created by Hermes after the AWS Wiki cost audit.

2026-08-04 safety re-review

The immutable upload helper now checks ETag, Cache-Control, and Content-Type before writing. Unchanged correctly-tagged assets incur only a HEAD request and are not uploaded again; a missing object or metadata mismatch is repaired. Mocked skip/repair tests, shell syntax, JavaScript syntax, workflow YAML parsing, git diff --check, and a full mdbook build all pass.

carlospolop and others added 3 commits August 4, 2026 11:53
Keep master's banner wording (the shortened catalog line) and re-apply the
webp badge swap on top of it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant