Skip to content
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

Merged
merged 62 commits into from
Dec 8, 2016
Merged

Improve build #1074

merged 62 commits into from
Dec 8, 2016

Conversation

hannesj
Copy link
Contributor

@hannesj hannesj commented Dec 4, 2016

The PR is done - it:

  • follows the style and naming rules (passes npm run lint)

  • doesn't break anything (passes npm run test-local and npm 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 images

  • any changed files are transformed to ES6

  • all new strings visible to users are

    • added to translations file
    • are translated to English, Finnish and Swedish (if not, add translations-needed label to PR)
  • all changed components

    • have examples
    • are included in the style guide
    • are included in the visual tests (added to gemini tests)

If this PR fixes a bug, it includes a new test that catches the bug to prevent regressions.

greenkeeper bot and others added 30 commits December 2, 2016 12:24
@@ -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, {
Copy link

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:

  1. user1 fetches app.js without Accept-Encoding header (or with Accept-Encoding value that has no precompressed file such as bzip2)
  2. the express-static-gzip does not Vary header in response
  3. proxy caches the result
  4. user2 asks for the resource with Accept-Encoding: br, gzip
  5. 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

@samuliheljo samuliheljo merged commit 04d6ff0 into master Dec 8, 2016
@samuliheljo samuliheljo deleted the improve-build branch December 8, 2016 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants