-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any idea how to disable range requests in Next.js ? #1
Comments
Hi @mderazon, no idea how to do this in Next.js I am sorry. No issue that I can find in Express repo. I don't think it is a bug because I don't think it is realistic for a streaming HTTP library to be able to calculate compressed content length ahead of time (without sacrificing performance). I think disabling compression is a fair workaround. |
So practically, once this PoP update rollout is completed, anyone using Azure CDN will have to disable compression in origin ? |
Only servers and frameworks that combine compression and range responses, and don't properly calculate the |
Which looks like includes Node.js / Express / Next.js servers with default config and probably more http servers that I don't know of, but even this list alone accounts for a lot of issues. If this is rolled out, isn't it going to break a lot of things ? I just tested it by disabling Next.js compression and sent a request through To me, it seems like this change will break lots of customer's products |
Compression is not on by default in Express, but you make a good point. The Envoy implications are troubling... I don't work for Microsoft anymore, so tagging @johndowns who may have an inside view. |
@mderazon can you email me daniel@larsen.nz? |
I just sent you an email. Appreciate your help on this |
Can confirm - we have been effected by Azure FD caching + Next.js default behaviour around compression/range. Next.js provides a setting to disable compression (https://nextjs.org/docs/app/api-reference/next-config-js/compress), but not ranges. Quite a tricky one to diagnose when the PoP migrations are progressively rolled out, so it works for most users but not a subset of PoPs |
Apps and Servers that make use of compression but cannot compute and set It makes no sense to respond And indeed it makes it incompatible with Azure front door caching. |
@mscbpi I don't think it's just node.js, for example we are using Envoy proxy (through Emissary Ingress) which is Golang based and same problem is there as well. |
Yep but then it limits CDN support at least Front Door and several public examples shows how MSFT is referring the Origin as a non-compliant source of issue (just as this repo describes), being strict about it. How many users will be able to tweak their origin to comply ? directus had the same problem with dynamic on-the-fly image compression/transformation (asked in the user request), and combined with Range Requests, wrong response headers in HTTP/206. And trickiness of setting the right values with that kind of process. My (accepted) suggestion has been to ignore Our frontend is Angular-based, thus the tweak there was to disable gzip compression, while enabling it on CDN side, so the user gets a cached and (brötli) compressed answer, but not without some adaptation in the code again. Not every Origin is one's self code or open source, and may not be configurable in that way. |
Isn't ignoring
|
I wanted to disable compression on Next.js as well and let the CDN handle it solely. Problem is that request also passes through Envoy (Ambassador API gateway) and there it's being compressed as well (if not already compressed) and same problem happens there. I can't really disable compression on the API gateway as many other apis are going through there as well and they need compression and I can't do "compression by path", it's either on or off.
I haven't been able to find any issue in their Github repos related to this which is weird. But maybe I haven't looked well enough. I am not familiar with the spec well enough to create an issue on these repos either |
Tried my luck |
It seems to be affected by the same issue although it's not using Express AFAIK
Also, is this misbehavior tracked somewhere in a Github issue in Node.js / Express repos ?
Is this even a bug ?
The text was updated successfully, but these errors were encountered: