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

How to reduce the size of vendors.bundle.js(13M)/commons.bundle.js(9.5M)? #57406

Closed
charliye opened this issue Feb 12, 2020 · 9 comments
Closed
Labels
chore performance Team:Operations Team label for Operations Team

Comments

@charliye
Copy link

Hi all,

Could you help answer my question? I'm using kibana:v6.5.4 in my lab. Thanks in advance!
How to reduce the size of vendors.bundle.js(13M)/commons.bundle.js(9.5M)?
After I start kibana, I find some of the bundle.js files are too large.

some bundle.js files:
-rw-r--r-- 1 root root 13M Feb 12 10:50 vendors.bundle.js
-rw-r--r-- 1 root root 51K Feb 12 10:50 vendors.style.css
-rw-r--r-- 1 root root 933K Feb 12 10:50 apm.bundle.js
-rw-r--r-- 1 root root 519K Feb 12 10:50 monitoring.bundle.js
-rw-r--r-- 1 root root 1.3M Feb 12 10:50 canvas.bundle.js
-rw-r--r-- 1 root root 1.4M Feb 12 10:50 infra.bundle.js
-rw-r--r-- 1 root root 1.6M Feb 12 10:50 ml.bundle.js
-rw-r--r-- 1 root root 9.5M Feb 12 10:50 commons.bundle.js
-rw-r--r-- 1 root root 2.9M Feb 12 10:50 kibana.bundle.js

@cjcenizal cjcenizal added Team:Operations Team label for Operations Team triage_needed labels Feb 12, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@mistic
Copy link
Member

mistic commented Feb 12, 2020

Hi @charliye

Those two specific bundles encloses the majority of the dependencies we use to run the product thats why they are so large.

However we took some actions to try to minimize this in the last 7.6.0 release. Could you please try that new version and see if that is more acceptable to your expectations?

@charliye
Copy link
Author

hi @mistic,

Thanks a lot for your response.
Let me have a try with version 7.6.0. BTW, what can I do if I want to minimize them in version 6.5.4?

@mistic
Copy link
Member

mistic commented Feb 13, 2020

@charliye it won't be easy. The possibly alleviation of the problem needs to be split in two different things.

1 - split commons bundle in more than one (through webpack config)
2 - split the dll chunks

For the problem part 1 we did some progress here #54079
For the problem part 2 we did this #54600

Both are merged in 7.6.0 so I really suggest you to try that version instead.

Finally in 7.7.0 the problem should also be less impacting as we also merged this #53976

@tylersmalley
Copy link
Contributor

These assets will also be cached by your browser after they are loaded once. I understand this is still not ideal, but we're working to reduce the overall payload size.

@charliye
Copy link
Author

Hi @tylersmalley,
I checked my response header when I accessed my kibana. I found the value of cache-control was must-revalidate. I'm not sure whether the value is ok for the cache aim. Could you help to confirm?

cache-control: must-revalidate
connection: close
content-encoding: gzip
content-type: application/javascript; charset=utf-8
Date: Thu, 13 Feb 2020 07:48:41 GMT
etag: "4b4a07cab3d7405a4d05b399050d497b874d6a93-/bundles/-gzip"
kbn-name: kibana
Transfer-Encoding: chunked
vary: accept-encoding

@tylersmalley
Copy link
Contributor

must-revalidate is expected. The asset will be cached and subsequent requests will validate the etag. If it's valid, it will return a 302 and the asset will be served from cache, otherwise it will be downloaded.

@hyramduke
Copy link

+1

@tylersmalley
Copy link
Contributor

Closing this, as we no longer ship a vendor's bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore performance Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

6 participants