# Large Javascript file under assets folder

**URL:** https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571
**Category:** Self-hosting
**Created:** [September 27, 2021, 4:26pm UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571 "2021-09-27T16:26:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![TechGeek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techgeek/32/274321_2.png) [@TechGeek](https://meta.discourse.org/u/TechGeek)
#### Post date: [September 27, 2021, 4:26pm UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/1 "2021-09-27T16:26:14Z")

</div>

One of the file /assets/application-7c87db9088046beb643be94b61428105469e084e8d02f141c57adfaf14168c63.js is almost 3.1 MB in size and causing lots of warning in error.log for Nginx reverse proxy.

`an upstream response is buffered to a temporary file /var/lib/nginx/proxy/2/77/0012036772 while reading upstream, client: XXXXXX`

- Does anybody know for what this much big javascript file is used for
- Is there a way to reduce size of this file. One way to reduce warning in Nginx will be to increase buffer size to 3.1 MB, but isn’t that little too much from default nginx configuration

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [September 27, 2021, 5:04pm UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/2 "2021-09-27T17:04:39Z")

</div>

When you first load a Discourse site, the full JavaScript application is sent to the browser (it’s then cached so subsequent page loads are much faster). That’s what that 3MB file is.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 27, 2021, 5:53pm UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/3 "2021-09-27T17:53:33Z")

</div>

Also worth keeping in mind that by following the [official install](https://meta.discourse.org/t/142537?silent=true) guide you get a pre-configured nginx reverse-proxy that serves this file using brotli compression that reduces it to 400kb.

---

<div class="post-metadata">

### Author: ![TechGeek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techgeek/32/274321_2.png) [@TechGeek](https://meta.discourse.org/u/TechGeek)
#### Post date: [September 28, 2021, 3:56am UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/4 "2021-09-28T03:56:56Z")

</div>

Thanks @Falco. Using separate web and data container and manual reverse proxy configuration. Looks like guide at [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) is for standalone container.

For pre-configured nginx reverse proxy configuration, do you mean using configuration from [discourse/config/nginx.sample.conf at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/config/nginx.sample.conf)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 28, 2021, 1:17pm UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/5 "2021-09-28T13:17:23Z")

</div>

> [@TechGeek](#):
>
> For pre-configured nginx reverse proxy configuration, do you mean using configuration from [discourse/nginx.sample.conf at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/config/nginx.sample.conf)

That config file is the template we use in the [official install](https://meta.discourse.org/t/142537?silent=true) guide, but it’s heavily modified by the install script during installation too.

I’m afraid we only provide the config file when running following our [official install](https://meta.discourse.org/t/142537?silent=true) guide. If you deviate from it you will have to be careful to not lose everything we support like brotli, HTTP/2, IPv6, etc.

---

<div class="post-metadata">

### Author: ![TechGeek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techgeek/32/274321_2.png) [@TechGeek](https://meta.discourse.org/u/TechGeek)
#### Post date: [September 28, 2021, 2:16pm UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/6 "2021-09-28T14:16:15Z")

</div>

@Falco By reading discourse forum, can feel separate web and db container is preferred or may be recommended way. It will be great if there is an official guide on manual nginx configuration or automatic setup for separate containers.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 28, 2021, 3:07pm UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/7 "2021-09-28T15:07:04Z")

</div>

Our preferred way to install is the one we documented as our [official install](https://meta.discourse.org/t/142537?silent=true) guide. That said, using a separate web/data container doesn’t affect the pre-configured nginx inside the web container, it should work the same way, without a need for an extra reverse-proxy.

---

<div class="post-metadata">

### Author: ![TechGeek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techgeek/32/274321_2.png) [@TechGeek](https://meta.discourse.org/u/TechGeek)
#### Post date: [November 5, 2021, 4:04am UTC](https://meta.discourse.org/t/large-javascript-file-under-assets-folder/204571/8 "2021-11-05T04:04:28Z")

</div>

Looking for optimization while hosting multiple discourse forum using: Nginx proxy → Separate Web and DB container. In this scenario I assume performance enhancement done by [official install](https://meta.discourse.org/t/142537?silent=true) has to be done manually in nginx proxy.
