简体   繁体   English

在ASP.net中组合和缓存多个JavaScript文件

[英]Combining and Caching multiple JavaScript files in ASP.net

Either I had a bad dream recently or I am just too stupid to google, but I remember that someone somewhere wrote that ASP.net has a Function which allows "merging" multiple JavaScript files automatically and only delivering one file to the client, thus reducing the number of HTTP Requests. 要么我最近做了一个糟糕的梦想,要么我对谷歌太愚蠢,但我记得某个地方有人写道,ASP.net有一个功能允许自动“合并”多个JavaScript文件,只向客户端提供一个文件,从而减少HTTP请求的数量。

Server Side, you still kept all the individual .js files, but the Runtime itself then creates one big JavaScript file which is then included in the script-tag instead and can be properly cached etc. 服务器端,您仍然保留所有单独的.js文件,但Runtime本身会创建一个大的JavaScript文件,然后将其包含在脚本标记中,并且可以正确缓存等。

In case that this function really exists and is not just a product of my imagination, can someone point me in the right direction please? 如果这个功能真的存在并且不仅仅是我想象的产物,那么有人可以指出我正确的方向吗?

It's called Script Combining . 它被称为脚本组合 There is a video example from asp.net explaining it here . 有一个来自asp.net的视频示例在这里解释它。

.Net 4.5内置了对Bundling和Minification的支持

你可以在这里找到一篇有用的文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM