# HTML size of \<head\> element is bloated

**URL:** <https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965>\
**Category:** Web\
**Created:** [April 14, 2021, 5:00pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965 "2021-04-14T17:00:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilya1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ilya1/32/9579_2.png) [@ilya1](https://devforum.zoom.us/u/ilya1)\
**Post date:** [April 14, 2021, 5:00pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/1 "2021-04-14T17:00:12Z")

</div>

**Description**  
Hello, it looks like Zoom Web SDK dumps a lot of stuff into the section of the html page. This results in the size of the page to be over 20mb.

This breaks reporting libraries (FullStory)

**Error**  
The full error message or issue you are running into.

**Which Web Client SDK version?**  
1.8.6

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Open Chrome’s Dev Tools and switch to the “Elements Tab”
2. Right click on the root `<html>` element and choose “Edit as HTML”
3. Copy the contents of the HTML and Paste into a new document on you computer.
4. Save the file and check its size.
5. Size of the head is over 20mb

**Device (please complete the following information):**

- Device: Mac
- OS: OS X
- Browser: Chrome

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [April 15, 2021, 6:03pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/2 "2021-04-15T18:03:35Z")

</div>

Hi @ilya1,

Thank you for using the Developer Forum. First, please try testing with the latest version of the [Web SDK](https://marketplace.zoom.us/docs/sdk/native-sdks/web#zoom-web-sdk) and see if the issue persists. There have been multiple bug fixes since your version of the SDK. You can test using our [Sample Web](https://github.com/zoom/sample-app-web) App to confirm if you see the same issue.

Please let me know if this helps.

Best,  
Donte

---

<div class="post-metadata">

**Author:** ![ilya1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ilya1/32/9579_2.png) [@ilya1](https://devforum.zoom.us/u/ilya1)\
**Post date:** [April 15, 2021, 6:44pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/3 "2021-04-15T18:44:06Z")

</div>

Yes, I tried version 1.9.1 and it makes the size every larger

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [April 17, 2021, 12:39am UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/4 "2021-04-17T00:39:00Z")

</div>

Hey @ilya1,

Where are you seeing that the Web SDK adds ~20MB to the size of the web page? While we are always working to improve the size and efficiency of the Web SDK, my understanding is that it shouldn’t be 20MB.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![ilya1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ilya1/32/9579_2.png) [@ilya1](https://devforum.zoom.us/u/ilya1)\
**Post date:** [April 17, 2021, 4:42pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/5 "2021-04-17T16:42:25Z")

</div>

Hi Max, I tried the sample app provided by zoom ([GitHub - zoom/sample-app-web: Zoom Web SDK Sample App](https://github.com/zoom/sample-app-web)) and it is still huge (22mb)

Here is how to replicate

1. git clone [git@github.com](mailto:git@github.com):zoom/sample-app-web.git
2. cd sample-app-web/Local
3. yarn
4. yarn start
5. open [http://0.0.0.0:9999/](http://0.0.0.0:9999/) in browser
6. Open Chrome’s Dev Tools and switch to the “Elements Tab”
7. Right click on the root `<html>` element and choose “Edit as HTML”
8. Copy the contents of the HTML and Paste into a new document on you computer.
9. Save the file and check its size - it is 22mb

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [April 19, 2021, 10:30pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/6 "2021-04-19T22:30:46Z")

</div>

Hey @ilya1,

Thank you for clarifying. I should note that the size of the copied HTML won’t be what is actually transferred over the network. This is due to caching and compression as well as reactive code that generates more code when it is run from your browser.

The best method to use is the Network tab of your browser’s developer tools. When I did this, I saw the data transferred was 6.6 MB. When it comes to a production app, you can reduce that size even further using server and client optimization (such as gzip and webpack).

Of course, we are also always working to improve the Web SDK and reduce the size while also improving browser support and adding features.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![ilya1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ilya1/32/9579_2.png) [@ilya1](https://devforum.zoom.us/u/ilya1)\
**Post date:** [April 19, 2021, 11:14pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/7 "2021-04-19T23:14:26Z")

</div>

Hi Max, thanks for your comment. Yes, I understand what you mean, however, some analytics tools (in this case, [Fullstory](https://www.fullstory.com/), but there are plenty of others) run after the full dom is generated and they transfer over the fully generated HTML code after React is done donig it’s thing. And that code is 22MB.

I see the same code blocks appear over and over again.  
For example, the following block appears 136 times. Is there a way to refactor it so it doesn’t duplicate so many times? Or open to other suggestions

```auto
    @-webkit-keyframes audio {
      0% {
        background-position: -136px -67px;
      }
      35% {
        background-position: -168px -67px;
      }
      50% {
        background-position: -200px -67px;
      }
      65% {
        background-position: -232px -67px;
      }
      80% {
        background-position: -296px -67px;
      }
      95% {
        background-position: -360px -67px;
      }
      100% {
        background-position: -200px -67px;
      }
    }

```

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [April 20, 2021, 8:43pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/8 "2021-04-20T20:43:11Z")

</div>

Hey @ilya1,

Thank you for clarifying, I see what you mean in regard to duplicate code. This should be improved when we release the more customizable version of the Web SDK with v2. In that version, we’ve refactored the dependencies used by the SDK.

I think the best option is to implement a dependency bundler such as [Webpack](https://webpack.js.org/). Webpack can create a dependency graph for each of your routes and then produce bundled assets that only include a single version of what is needed on the current page.

You can look to our [Sample Vue.js App](https://github.com/zoom/websdk-sample-vuejs), [Sample Angular App](https://github.com/zoom/websdk-sample-angular) or [Sample React App](https://github.com/zoom/websdk-sample-react/tree/master/src) for an example of how to do that with some popular frameworks.

Let me know if that helps.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![ilya1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ilya1/32/9579_2.png) [@ilya1](https://devforum.zoom.us/u/ilya1)\
**Post date:** [April 20, 2021, 8:54pm UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/9 "2021-04-20T20:54:22Z")

</div>

I see. Sure, happy to try webpack solution (I have use webpack in my app). However, I don’t see webpack configuration in the sample app [GitHub - zoom/websdk-sample-react: Use the Zoom Web SDK in a React App](https://github.com/zoom/websdk-sample-react)

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [April 22, 2021, 1:01am UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/10 "2021-04-22T01:01:12Z")

</div>

Hey @ilya1,

We used the `create-react-app` command to create the scaffolding for that project which includes the following features:

- React, JSX, ES6, TypeScript and Flow syntax support.
- Language extras beyond ES6 like the object spread operator.
- Autoprefixed CSS, so you don’t need `-webkit-` or other prefixes.
- A fast interactive unit test runner with built-in support for coverage reporting.
- A live development server that warns about common mistakes.
- A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
- An offline-first [service worker](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers) and a [web app manifest](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/), meeting all the [Progressive Web App](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) criteria. ( _Note: Using the service worker is opt-in as of `react-scripts@2.0.0` and higher_ )
- Hassle-free updates for the above tools with a single dependency.

More information can be found [here](https://github.com/facebook/create-react-app).

As you can see there, it includes a build script to bundle resources. If you want to customize the configuration of Webpack or any other features there, you can follow the steps below:

> <https://stackoverflow.com/questions/48395804/where-is-create-react-app-webpack-config-and-files/48396154#48396154>

Let me know if that helps.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 22, 2021, 11:01am UTC](https://devforum.zoom.us/t/html-size-of-head-element-is-bloated/47965/11 "2021-05-22T11:01:41Z")

</div>

Closed on May 22, 2021, 11:01am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
