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

Feat: Support to compress and cache the static files #777

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

barnettZQG
Copy link
Collaborator

Description of your changes

Fixes #771

Before, the static files don't compress. Loading the core JS file takes a long time.

image

Testing on local, the network is very fast.

After adding the gzip compress:

image

The content size reduces by 75%.

After the first request, other requests will hit the cache.
image

The time reduces by 35%.

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run yarn lint to ensure the frontend changes are ready for review.
  • Run make reviewableto ensure the server changes are ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

Special notes for your reviewer

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
@codecov
Copy link

codecov bot commented Apr 16, 2023

Codecov Report

Patch coverage: 60.00% and project coverage change: +0.08 🎉

Comparison is base (d3985d1) 61.03% compared to head (87002f8) 61.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #777      +/-   ##
==========================================
+ Coverage   61.03%   61.11%   +0.08%     
==========================================
  Files         107      109       +2     
  Lines       19009    19091      +82     
==========================================
+ Hits        11602    11668      +66     
- Misses       5966     5979      +13     
- Partials     1441     1444       +3     
Flag Coverage Δ
apiserver-unittests 33.71% <65.27%> (+0.15%) ⬆️
server-e2e-tests 49.82% <22.35%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
pkg/server/server.go 55.38% <25.00%> (-0.95%) ⬇️
pkg/server/utils/filters/gzip.go 45.45% <45.45%> (ø)
pkg/server/utils/filters/js-cache.go 82.05% <82.05%> (ø)
pkg/features/server.go 100.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
@barnettZQG barnettZQG merged commit 000b65c into kubevela:main Apr 17, 2023
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.

[Feature] Improve the performance that proxy static files
2 participants