This website requires JavaScript.
Explore
Help
Sign In
vincent
/
gerbeur
Watch
1
Star
0
Fork
0
You've already forked gerbeur
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
6ab398e6870f336527f78f04b8521b984ded93a2
gerbeur
/
api
/
middleware
/
compress.ts
khannurien
6ab398e687
v4: the API's JSON and the page are sent compressed — a page of the feed went out as it was, twenty kilobytes where a fifth does: only the built frontend's files were compressed, at build time, and Deno's server leaves alone a response whose length Oak has set. compressMiddleware (api/middleware/compress.ts), installed after the error middleware and around everything that sets a body, sends an object or array, and a string whose type its route set, in brotli or gzip as the request's Accept-Encoding takes, a coding refused with q=0 not being taken, from a kilobyte up, the threshold the build compresses from. Brotli is at quality 5, the frontend's files, compressed once, staying at 11. Files, streams and bytes, a response already encoded, a HEAD and one marked no-transform go out as they are, and a compressible answer says Vary: Accept-Encoding whether compressed or not.
...
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com
>
2026-10-10 19:01:06 +00:00
3.7 KiB
Raw
Blame
History
View Raw
Reference in New Issue
View Git Blame
Copy Permalink