Brotil compression not active.

I'm in the process of rewriting my web application and migrating it from Pages to Workers however, after checking the metrics from the Workers version vs the Pages version I noticed that Brotil, GZip or any other compression system isn't active on my worker. Is this intended behaviour?
4 Replies
fry69
fry692mo ago
I think so, yes. Pages do get a special cache treatment which Worker do not share by default (maybe static assets do, they are more like Pages). Workers seem to directly output and those outputs do not get cached. Think of an Express server spitting out data, you won't get gzip/brotli compression there too (and if you shove a middleware for that in, it will have a noticeable CPU + latency impact, which is questionable these days as the pipes are big enough)
putty
puttyOP2mo ago
Hm, I was porting my Next.js app to Workers. I guess even though Next,js on workers is newer and being more pushed for that Next.js on pages, there's no reason and in this instance a disadvantage to make the swap. Is Next.js on Workers still restricted to the Edge runtime?
fry69
fry692mo ago
Dunno. Ask in #next-on-pages
putty
puttyOP2mo ago
I assumed that was specific to Next.js on Pages, not on Workers.
Want results from more Discord servers?
Add your server