blog.git

blog

~ Personal research notes. blog.sqzer.com
git clone https://github.com/debuman/blog.git
commit 7857194024d11f2f27af79021e57664ed4423128
parent f333bb27ffe4aa6729cc44c19c5a3772ae5387f9
Author: sqzer <110329244+sqzer-x@users.noreply.github.com>
Date: Fri, 25 Sep 2026 19:55:05 +0900

perf: serve the grid scans and the portrait at twice their display size

public/uploads bypasses Astro's image service, so every file ships at
the size it was uploaded. The three book-page scans in the cognitive
dissonance post were 1600x2134 (802 KB together) and are drawn 299px
wide on a desktop and 104px on a phone, where they were that page's
LCP element. They are now 600x800 WebP, 2x the largest slot and still
legible when zoomed: 215 KB together. The about portrait, drawn at
232x290, goes from 720x900 to 480x600 (42 KB to 25 KB).

Only images whose displayed size CSS fixes were resized: a standalone
image renders at its intrinsic width, so shrinking it would shrink it
on screen. URLs are unchanged and satteriProse reads the new sizes, so
no post changes. Measured before and after in Chrome at 1440 and 375:
every box is within 0.1 px (800 is 2134 x 600/1600 rounded) and page
heights are equal. On a 1.6 Mbps link the post transferred 947 KB
before and 375 KB after.

Diffstat:
Mpublic/uploads/profile.jpg | 0binary
Mpublic/uploads/research/1-775fc3ed.webp | 0binary
Mpublic/uploads/research/2-ee522a4a.webp | 0binary
Mpublic/uploads/research/3-5a25cd9b.webp | 0binary
4 files changed, 0 insertion(+), 0 deletion(-)

diff --git a/public/uploads/profile.jpg b/public/uploads/profile.jpg
Binary files differ.
diff --git a/public/uploads/research/1-775fc3ed.webp b/public/uploads/research/1-775fc3ed.webp
Binary files differ.
diff --git a/public/uploads/research/2-ee522a4a.webp b/public/uploads/research/2-ee522a4a.webp
Binary files differ.
diff --git a/public/uploads/research/3-5a25cd9b.webp b/public/uploads/research/3-5a25cd9b.webp
Binary files differ.