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

Add support for brotli compression #8169

Merged

Conversation

tanmoyopenroot
Copy link
Contributor

@tanmoyopenroot tanmoyopenroot commented Oct 3, 2020

Feat #5910

Checklist

  • Includes tests
  • Update documentation

Description of what you did:

Upgrade koa-compress and add support for Brotli compression

Default config
{
  "gzip": {
    "enabled": false,
    "options": {
      "br":  false
    }
  }
}
On add following config
{
  "gzip": {
    "enabled": true,
    "options": {
      "br":  true,
      "threshold": 2048
    }
  }
}

Screenshot 2020-10-03 at 9 53 39 PM

@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

Merging #8169 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8169      +/-   ##
==========================================
+ Coverage   32.96%   33.03%   +0.06%     
==========================================
  Files        1197     1219      +22     
  Lines       13020    13562     +542     
  Branches     1286     1348      +62     
==========================================
+ Hits         4292     4480     +188     
- Misses       7885     8200     +315     
- Partials      843      882      +39     
Flag Coverage Δ
#front 24.70% <ø> (-0.36%) ⬇️
#unit 54.10% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rapi-admin/admin/src/hooks/useFetchRole/reducer.js 80.00% <0.00%> (-20.00%) ⬇️
...min/admin/src/components/Roles/Permissions/init.js 80.00% <0.00%> (-20.00%) ⬇️
packages/strapi-admin/services/permission.js 77.57% <0.00%> (-14.00%) ⬇️
...in/src/containers/Users/ProtectedEditPage/index.js 87.50% <0.00%> (-12.50%) ⬇️
...t-type-builder/controllers/validation/relations.js 50.00% <0.00%> (-12.50%) ⬇️
.../admin/src/components/Roles/Permissions/reducer.js 85.41% <0.00%> (-12.15%) ⬇️
...ages/strapi/lib/services/entity-validator/index.js 54.11% <0.00%> (-9.78%) ⬇️
packages/strapi/lib/core-api/service.js 64.44% <0.00%> (-4.79%) ⬇️
.../admin/src/containers/Webhooks/EditView/reducer.js 82.35% <0.00%> (-4.32%) ⬇️
...admin/admin/src/containers/Roles/EditPage/index.js 55.17% <0.00%> (-4.09%) ⬇️
... and 106 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a28860...140615b. Read the comment docs.

Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

Thanks let's make it even better ;)

packages/strapi/lib/middlewares/gzip/index.js Show resolved Hide resolved
docs/v3.x/concepts/middlewares.md Outdated Show resolved Hide resolved
Signed-off-by: tanmoyopenroot <tanmoy.openroot@gmail.com>
Signed-off-by: tanmoyopenroot <tanmoy.openroot@gmail.com>
Signed-off-by: tanmoyopenroot <tanmoy.openroot@gmail.com>
@alexandrebodin alexandrebodin added this to the 3.2.1 milestone Oct 7, 2020
@alexandrebodin alexandrebodin added source: core:strapi Source is core/strapi package issue: enhancement Issue suggesting an enhancement to an existing feature labels Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature source: core:strapi Source is core/strapi package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants