Skip to content

Optimize web static assets#7974

Merged
ankur-arch merged 16 commits into
mainfrom
codex/image-transformations-compute
Jun 23, 2026
Merged

Optimize web static assets#7974
ankur-arch merged 16 commits into
mainfrom
codex/image-transformations-compute

Conversation

@sorenbs

@sorenbs sorenbs commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Audited and optimized tracked public/static assets across blog, site, docs, and eclipse.
  • Replaced the three oversized font/base64-heavy blog hero SVGs with lightweight SVG artwork and 1200x630 PNG social images under 500 KB.
  • Converted 11 oversized base64-wrapped blog hero SVGs to optimized PNGs and updated their heroImagePath references.
  • Removed stale public HTML dumps and unreferenced/comment-only legacy blog videos.
  • Minified the checked-in Postman collection and updated its generator to keep future output compact.

Asset Report

Full report is committed in asset-optimization-report.md.

  • Assets in scope before: 2,390
  • Assets in scope after: 2,378
  • Total before: 1.02 GB (1,099,975,012 bytes)
  • Total after: 861.76 MB (903,622,548 bytes)
  • Total saved: 187.26 MB (196,352,464 bytes, 17.9%)
  • Assets changed in report: 795

Top savings by type:

Extension Files changed Saved
.svg 299 82.33 MB
.png 394 38.70 MB
.gif 45 29.95 MB
.mp4 6 17.89 MB
.mov 1 15.82 MB

Validation

  • git diff --check
  • pnpm install --frozen-lockfile
  • pnpm --filter blog run types:check
  • pnpm --filter docs run fetch-openapi
  • pnpm --filter docs run generate:postman-collection
  • SVG audit: 0 font-face / data:font hits remain; only SVG >1 MB is apps/site/public/illustrations/careers/world_map_dots.svg, which is a dense vector with no embedded font payload.

Follow-up: extra PNG compression (pngquant pass)

A review pass found the PNGs in this PR still had room to shrink, with no quality loss. Added in commit 86c674e.

Improvements

  • Re-compressed 372 PNGs added or modified by this PR.
  • ~61 MB saved on top of the existing optimization: 123.7 MB → 62.5 MB across the changed PNG set (49%).
  • Includes the 11 blog hero images that were converted from base64 SVGs but left as full-truecolor PNGs (e.g. one Accelerate hero: 338 KB → 134 KB).
  • Binary-only changes — no code, type, or build impact.

Strategies used

  • pngquant at a quality floor of 82–98 (lossy palette quantization) — far better gradient handling than naive 256-color quantization.
  • Keep-the-smaller rule — the optimized file is only kept when it is actually smaller than the original.
  • Quality-gated skips — 22 PNGs that could not meet the quality floor were left untouched (no forced degradation).
  • Metadata stripped from each image.
  • Visual + integrity verification — spot-checked gradient heroes, a text-heavy screenshot, and a social meta card; confirmed all 372 outputs are still valid images.

Not changed (intentional)

  • SVGs — svgo reports 0% headroom; already optimized. Genuine vector heroes kept as SVG.
  • Large GIFs (up to 41 MB) — untouched by this PR and the biggest remaining files in the repo. Worth a separate effort to convert to MP4/WebM (changes <img><video> rendering).

Note (unrelated to assets)

  • The new image-transformations-with-bun-on-prisma-compute post links to /blog/create-prisma-deploy-prisma-compute, which has no post yet — it will 404 until that post merges (or the link is removed).

Summary by CodeRabbit

  • Documentation

    • Updated hero images on multiple blog posts from SVG to PNG format for improved rendering.
    • Removed commented-out code blocks from select blog articles.
  • Chores

    • Optimized JSON output formatting in collection generation script to use compact format.

sorenbs and others added 12 commits June 18, 2026 13:16
… assertive

- Tighten the blog intro and prose; cut hype words and em-dash pile-ups
- Set blog date to 2026-06-19 and series index to 6 (avoids clash with create-prisma)
- Make the docs intro/voice more direct and add backlinks (deployments, branching, configuration, pricing, blog)
- Cross-link the blog to the rest of the Compute series and to Prisma Postgres

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… prose

Apply the deslop pass without changing meaning: remove filler ("Let's break
that down", "honest", "genuinely", "precisely"), collapse duplicated ideas
(the cache-headers and fastest-transform lead-ins), lock "standalone image
service" as one term, and replace em-dash asides with cleaner punctuation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Spellcheck: add "lanczos" and "EXIF" to the docs cspell dictionary (CI was failing)
- Links: drop the cross-domain link to the not-yet-published blog post (lychee 404)
- Docs: flag that the minimal example's `immutable` header assumes versioned sources, linking to the Caching section
- Blog: give Bun.hash a fixed seed so the disk-cache filename is stable across restarts and instances

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Avoids an empty lead paragraph (template renders page.data.excerpt directly).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…laims

- Replace the placeholder hero with the "Image transforms as app logic"
  pipeline SVG, add the PNG as the social/meta image, update alt text
- Positioning: "for free" -> "at no extra charge" (you still pay normal Compute
  usage), drop an unearned "fast"

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jun 23, 2026 7:29pm
docs Ready Ready Preview, Comment Jun 23, 2026 7:29pm
eclipse Ready Ready Preview, Comment Jun 23, 2026 7:29pm
site Ready Ready Preview, Comment Jun 23, 2026 7:29pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

Walkthrough

Eleven blog MDX files have their heroImagePath frontmatter updated from .svg to .png assets. Four blog MDX files have commented-out <Video /> JSX blocks and trailing whitespace removed. The Postman collection generation script switches from pretty-printed to compact JSON.stringify output.

Changes

Blog MDX content cleanup

Layer / File(s) Summary
Hero image paths: SVG → PNG in frontmatter
apps/blog/content/blog/agentic-engineering-at-prisma/index.mdx, apps/blog/content/blog/announcing-accelerate-usrvpi6sfkv4/index.mdx, apps/blog/content/blog/backend-prisma-typescript-orm-with-postgresql-auth-mngp1ps7kip4/index.mdx, apps/blog/content/blog/drive-and-the-maker/index.mdx, apps/blog/content/blog/grover-customer-success-story-nxkWGcGNuvFd/index.mdx, apps/blog/content/blog/introducing-create-prisma/index.mdx, apps/blog/content/blog/panther-customer-story-pdmdrrhtupsl/index.mdx, apps/blog/content/blog/pearly-plan-customer-success-pdmdrRhTupve/index.mdx, apps/blog/content/blog/prisma-7-ama-clearing-up-the-why-behind-the-changes/index.mdx, apps/blog/content/blog/prisma-mongodb-preview-release/index.mdx, apps/blog/content/blog/prisma-studio-3rtf78dg99fe/index.mdx
Eleven MDX frontmatter blocks have heroImagePath switched from .svg to .png assets. No other frontmatter or body content is modified.
Remove commented-out Video embeds and trailing whitespace
apps/blog/content/blog/announcing-prisma-2-n0v98rzc8br1/index.mdx, apps/blog/content/blog/improving-query-performance-using-indexes-2-MyoiJNMFTsfq/index.mdx, apps/blog/content/blog/type-safe-js-with-jsdoc-typeSaf3js/index.mdx, apps/blog/content/blog/using-graphql-nexus-with-a-database-pmyl3660ncst/index.mdx
Commented-out <Video /> JSX blocks and adjacent trailing blank lines are deleted from four blog posts; no live content is changed.

Postman Collection Script

Layer / File(s) Summary
Compact JSON output
apps/docs/scripts/generate-postman-collection.ts
JSON.stringify call for the written Postman collection file drops the null, 2 indentation arguments, producing a single-line compact output instead of pretty-printed JSON.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • prisma/web#7844: Introduced the agentic-engineering-at-prisma and drive-and-the-maker blog MDX pages whose heroImagePath values are updated in this PR.
  • prisma/web#7904: Also updates blog MDX frontmatter to reference .png hero images via heroImagePath, the same pattern applied here across eleven posts.
  • prisma/web#7951: Performs a similar image asset swap (SVG → PNG) in blog frontmatter/content, directly overlapping with the hero image conversions in this PR.

Comment @coderabbitai help to get the list of available commands.

Re-encode 372 of the PR's added/modified PNGs with pngquant at a
quality floor of 82-98 (lossy palette, strip metadata), keeping the
original whenever the optimized output was not smaller. This includes
the 11 blog hero images that were converted from base64-wrapped SVGs to
full-truecolor PNGs in this PR but left unquantized.

Saves ~61 MB (123.7 MB -> 62.5 MB across the changed PNG set, 49%) with
no visible quality loss; gradient heroes and text-heavy screenshots
were spot-checked. 22 PNGs that could not meet the quality floor were
left untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ations-compute

# Conflicts:
#	apps/blog/content/blog/agentic-engineering-at-prisma/index.mdx
#	apps/blog/content/blog/drive-and-the-maker/index.mdx
#	apps/blog/public/image-transformations-with-bun-on-prisma-compute/imgs/hero.svg
#	apps/blog/public/image-transformations-with-bun-on-prisma-compute/imgs/meta.png
#	apps/docs/content/docs/compute/meta.json
@argos-ci

argos-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jun 23, 2026, 7:40 PM

@ankur-arch ankur-arch marked this pull request as ready for review June 23, 2026 19:42
@ankur-arch ankur-arch merged commit 9311655 into main Jun 23, 2026
16 checks passed
@ankur-arch ankur-arch deleted the codex/image-transformations-compute branch June 23, 2026 19:42
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.

2 participants