Add AOT gzip content-encoding support for main build files.#565
Merged
rauchg merged 3 commits intovercel:masterfrom Dec 29, 2016
Merged
Add AOT gzip content-encoding support for main build files.#565rauchg merged 3 commits intovercel:masterfrom
rauchg merged 3 commits intovercel:masterfrom
Conversation
Currently we only do this for main.js and commons.js only.
rauchg
reviewed
Dec 29, 2016
server/index.js
Outdated
| } | ||
|
|
||
| res.setHeader('Content-Encoding', 'gzip') | ||
| return await this.serveStatic(req, res, gzipPath) |
Member
There was a problem hiding this comment.
return await is not needed. can just be return
Member
|
Would it be easy to write a test? |
Member
|
Adjusted the issue to divide the task in two parts per your recommendation @arunoda |
Contributor
Author
|
@rauchg Yep. |
rauchg
reviewed
Dec 29, 2016
server/build/gzip.js
Outdated
| const nextDir = path.resolve(dir, '.next') | ||
|
|
||
| await gzip(path.resolve(nextDir, 'commons.js')) | ||
| await gzip(path.resolve(nextDir, 'main.js')) |
Member
There was a problem hiding this comment.
await Promise.all could have a perf advantage here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #555
Currently, we only do this for
main.jsandcommons.jsonly.We can do this for individual
.jsonpages as well.For that, we may need to change a bit of how we save pages and so on.
I think we could handle it in a different PR.