- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.4k
Remove the npm gzip script. #2432
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
Conversation
| 👍 up to the website team, it looks right to me: I guess that's all good. Don't let me hold it up. | 
| Which compression level does CF use? If it's not 11/9 for brotli/gzip, there could still be gains had by precompressing assets (I do have a module for that). | 
| That I don't know TBH. I don't think they use the best compression, though, since it's slow. I tried https://tools.paulcalvano.com/compression.php and it seems it's 5. | 
| @rvagg can you link the  Also, if nginx has a brotli module loaded, we could use  | 
| For what is worth, the diff in TTFB is ~100ms AFAICT. EDIT: Which might be due to something else, I can't tell for sure myself. https://gtmetrix.com/compare/csIu6DJG/s4fDLhlk So, if the server conf supports serving precompressed assets, we should drop this PR and instead use your solution @silverwind to generate both br and gzip assets. | 
| The server uses  Now I do wonder how Cloudflare handles the case of the source server serving brotli, I think it needs to be checked, not that the work is in vain if Cloudflare compresses again regardless. | 
| @silverwind how do you want to proceed with this? | 
| @silverwind friendly ping | 
| Just so that we are safe, @rvagg is the  | 
| Yes, it's used by the next line, you need to remove it from there too.  | 
Since Cloudflare is being used, Brotli compression is used.
| Oops, that was a rebase error, fixed now. Thanks for the webhook info, I wasn't aware it existed. It seems we are building node-sass each time :/ I guess #2724 might help in this regard. | 
| @silverwind ping | 
| I'm unsure here. If we keep gzip it looks like this (assuming cloudflare supports retrieving gzip): origin (gzip) -> cloudflare (un-gzip + brotli) -> user If we remove gzip: origin (uncompressed) -> cloudflare (brotli) -> user The first method saves bandwidth, while the second one saves cpu time. Ideal case would of course be serving brotli+gzip from the source, but that needs a non-default nginx module. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I guess with proper caching, these origin -> cloudflare transfers probably only happen when files change, so it's probably better overall to remove it and shave of a few seconds from the deploy runtime.
| Thanks @silverwind. @rvagg your thoughts? | 
| fine by me I suppose | 
| Alright, let's merge this and if there's anything unusual @rvagg we can revert it. | 
Since Cloudflare is being used, Brotli compression is used.
Closes #2429
Draft until @rvagg feels the Brotli switch is fine