-
Notifications
You must be signed in to change notification settings - Fork 356
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
fix: compress data from API for the page load performance improvement #8720
Conversation
✅ Deploy Preview for determined-ui canceled.
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #8720 +/- ##
==========================================
- Coverage 47.26% 47.26% -0.01%
==========================================
Files 1045 1045
Lines 166710 166713 +3
Branches 2246 2246
==========================================
- Hits 78792 78791 -1
- Misses 87760 87764 +4
Partials 158 158
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -966,10 +966,15 @@ func (m *Master) Run(ctx context.Context, gRPCLogInitDone chan struct{}) error { | |||
// Other static files should only be cached for a short period of time | |||
cacheFileShortTerm := regexp.MustCompile(`.(antd.\S+(.css)|ico|png|jpe*g|gif|svg)$`) | |||
|
|||
// API endpoints | |||
apiRegex := regexp.MustCompile(`^/api/.+$`) | |||
|
|||
gzipConfig := middleware.GzipConfig{ | |||
Skipper: func(c echo.Context) bool { |
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.
question: is there something we don't wanna compress? I followed the current code, but not sure if we want Skipper
here
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.
hmmm I'm not familiar with compression... @maxrussell would you have any thoughts?
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.
Nothing I can think of. Seems like a good change.
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.
ok, i'll remove Skipper
and relavant variable(s), then merge this PR. thanks for the review
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.
After some investigation, i conclude that Skipper
is still required for gzip.
i found that test_gc_checkpoints_lfs
test case should avoid being compressed on CI (look at CI error)
Also, according to @azhou-determined,
gzip didn’t play nicely with the tensorboard profiler plugin. Tensorboard wouldn’t load when we compressed the responses
bb44532
to
2f51abb
Compare
This reverts commit 2f51abb.
Description
WEB-1870
The response data from (almost?) all determined AI API endpoints were not compressed at all, so that caused long response time with
Fast 3G network
(look atContent download
time).Especially,
experiments-search
API usually returns big data, so this PR improve the page loading time around 10x.Before
After
Test Plan
Content-Encoding: gzip
in response headerjs/css/html
files are still compressedCommentary (optional)
Checklist
docs/release-notes/
.See Release Note for details.
Ticket