aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread-cache.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-11 22:06:12 -0700
committerAdam Soltys <[email protected]>2026-10-11 22:06:12 -0700
commit8ff0bf21e308d4907cc2620d80f238a10341a28d (patch)
tree4e6e6a3995fc4d469313100b69ef9768c330aadc /src/thread-cache.js
parenta34769e3f60aa5b6920e4e2c9e0a9ee1013cacd1 (diff)
downloadcoinosv3-8ff0bf21e308d4907cc2620d80f238a10341a28d.tar.gz
coinosv3-8ff0bf21e308d4907cc2620d80f238a10341a28d.zip
Feed: a picture from a host that won't hand over its bytes paints from a server-made copy. The app shrinks a post's photo to the column's size itself (an 1100px copy made once, kept on disk) — but only when the host allows CORS; one that doesn't (primal's blossom, nostrcheck, most personal sites) left the <img> painting the original, and a 9528×6328 camera file froze a wheel scroll for 400 ms on its texture upload. vmedia now has /vmedia/pic.webp?s=col|tile&u=<picture>: the picture at 1100px wide (or a 360px square of its middle for the grid), made with libvips (shrink-on-load, so the original is never decoded whole; turned the way its EXIF says; alpha kept; stripped) as WebP, cached on disk and at the CDN for everyone. The usual guards: https on public addresses only, each redirect's host checked, 60 MB cap, the bytes sniffed (a GIF is refused — its copy would be a still), a few jobs at a time, 600 new copies per address per hour, an 8 GB cache. The client asks the server for the column copy when the host is known to keep its bytes (or has just refused, or there's no worker to make one here), keeps it in the same cache as the copies it makes, and takes the server's tile for the grid the same way; a picture the server has no copy for paints as before. The container gets libvips-tools (Dockerfile). tools/pic-proxy-test.js (canned server answers). Server measured on cs: a 3072×4608 photo in 0.5 s the first time, a millisecond after; feed-stability's two pre-existing asserts still fail on 491904e.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src/thread-cache.js')
0 files changed, 0 insertions, 0 deletions