-
Notifications
You must be signed in to change notification settings - Fork 129
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
Improve build #1074
Improve build #1074
Conversation
…' into improve-build
…nto improve-build
…s-0.8.1' into improve-build
…6.8.0' into improve-build
…into improve-build
@@ -43,7 +44,8 @@ function setUpStaticFolders() { | |||
const staticFolder = path.join(process.cwd(), '_static'); | |||
// Sert cache for 1 week | |||
const oneDay = 86400000; | |||
app.use(config.APP_PATH, express.static(staticFolder, { | |||
app.use(config.APP_PATH, expressStaticGzip(staticFolder, { |
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.
The experss-static-gzip does not correctly implement the Vary header because it does not send the Vary header always for resource that has a precompressed version available.
The Vary header is only used by caching proxies and the failure case can be for example that:
- user1 fetches app.js without Accept-Encoding header (or with Accept-Encoding value that has no precompressed file such as bzip2)
- the express-static-gzip does not Vary header in response
- proxy caches the result
- user2 asks for the resource with Accept-Encoding: br, gzip
- the proxy finds the uncompressed version and serves that one (because the response did not have proper Vary)
If the uncompressed also had a Vary header the proxies would not get 'poisoned' with uncompressed versions. This is normally not a problem for internal applications, but with the wild west of internet and it's caches it would be much safer to have the header correctly implemented.
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.
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.
Fixed in 0.2.2
…' into improve-build
…l-0.4.0' into improve-build
…into improve-build
…' into improve-build
The PR is done - it:
follows the style and naming rules (passes
npm run lint
)doesn't break anything (passes
npm run test-local
andnpm run test-browserstack
)design is as expected. NOTE! visuals are compared using HSL theme (
CONFIG=hsl npm run dev
).-- If no design changes:
BS_USERNAME=user BS_ACCESS_KEY=key npm run test-visual
passes-- If design changes:
BS_USERNAME=user BS_ACCESS_KEY=key npm run test-visual-update
to generate new imagesany changed files are transformed to ES6
all new strings visible to users are
all changed components
If this PR fixes a bug, it includes a new test that catches the bug to prevent regressions.