类似站点之间共享目录中的常见共享 CSS JS 文件?

发布于 2024-10-02 19:24:20 字数 408 浏览 0 评论 0原文

后台信息: 我有一个 ISS6 网络服务器托管多个网站。我有大约 15 个域,这些域可以被视为共享样式、布局等的“姐妹”站点,但它们仍然有自己的自定义样式。 (除了这些基本网站之外,我还没有创建任何内容)

因此问题是:由于每个网站的 CSS 和 JS 的很大一部分都是相同的,因此有哪些方法可以共享通用的主 CSS 和 JS ;同一 IIS 服务器上的站点之间的 JS 目录?

我知道我可以在其中一个域上托管这个公共文件的主目录,然后从那里开始,但这似乎不是最优雅的选择。或者我也可以为每个域提供自己的 CSS 和 JS 文件的个人副本,这可能是最糟糕的选择。

我不使用任何版本控制软件或 Visual Studio,只使用 notepad++,因此我不太关心开发人员之间共享文件。

感谢您的任何意见。

Backgournd info:
I have a ISS6 webserver hosting multiple websites. I have about 15 domains that could be considered "sister" sites that share styles, layouts, etc but they still will have their own customization styles. (I haven't created anything but these basic sites just yet)

The question is thus: since a good portion of the CSS and JS for each site will be the same, what are some ways to share a common master CSS & JS directory between sites on the same IIS server?

I know I could host this master directory of common files on one of the domains and it from there but that doesn't seem like the most elegant option. Or I could give each domain its own personal copy of the CSS and JS files as well which probably the worst option.

I do not use any version control software or Visual Studio, just notepad++ so I'm not so concerned with sharing files among developers.

Thanks for any input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最笨的告白 2024-10-09 19:24:20

对于历史记录,我建议您实际上将共享文件托管在一个单独的域上。特别是如果这就是该域的全部用途。

主要好处是域将是无 cookie 的(减少每个 HTTP 调用的体积)。这与将共享文件托管在 CDN 上的最佳解决方案相比只是一步之遥。 Amazon 的 S3/CloudFront 解决方案非常实惠。

For historical record, I'd recommend that you infact DO host your shared files on a single, separate domain. Especially if that is all that domain is used for.

The primary benefit is that the domain will be cookieless (reducing bulk in each HTTP call). It's one step down from the optimum solution which would be to host your shared files on a CDN. Amazon's S3/CloudFront solution is very affordable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文