# 在 Discourse 中，所有 js 和 css 文件都是单独呈现的。为什么不将它们合并成一两个文件来提供呢？

**URL:** <https://meta.discourse.org/t/in-discourse-all-js-and-css-files-are-presented-separately-why-dont-we-combine-them-into-one-or-two-files-and-present-them/306793>\
**Category:** Development\
**Tags:** css\
**Created:** [2024 年5 月 5 日 12:16 UTC](https://meta.discourse.org/t/in-discourse-all-js-and-css-files-are-presented-separately-why-dont-we-combine-them-into-one-or-two-files-and-present-them/306793 "2024-05-05T12:16:44Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)\
发布日期： [2024 年5 月 5 日 12:16 UTC](https://meta.discourse.org/t/in-discourse-all-js-and-css-files-are-presented-separately-why-dont-we-combine-them-into-one-or-two-files-and-present-them/306793/1 "2024-05-05T12:16:45Z")

</div>

在 Discourse 中，所有 js 和 css 文件都是单独呈现的。多年来，我一直认为将这些文件合并、优化和呈现是更好的做法。如果我遗漏了什么重要的事情，请警告我，但遗憾的是，初始加载速度非常慢，减少这些文件的数量是否有益？

例如，如果只有 1-2 个 css 文件而不是 30 个 css 文件，是否能进一步加快进程？

想象一下，如果您的网站在地址栏输入并按 Enter 键后，在 1-2 秒内打开。嗯，那将是太棒了。

[https://www.webpagetest.org/result/240505\_BiDc8X\_6JJ/](https://www.webpagetest.org/result/240505_BiDc8X_6JJ/)

![video](https://global.discourse-cdn.com/meta/original/4X/a/b/1/ab1147fec62230a11b026eb24d337cf8a5f783b1.gif)

**我同意，它非常实用，打开后速度非常快，我们对此非常满意……让我们再改进一点，让它成为最好的中的最好的** 🙂

---

_[View the full topic](https://meta.discourse.org/t/in-discourse-all-js-and-css-files-are-presented-separately-why-dont-we-combine-them-into-one-or-two-files-and-present-them/306793)._
