简体   繁体   中英

How to minify and combine Javascript and CSS

Can someone give me pointers on how I can minify and combine my CSS as the site I'm working on has performance issues. Also, are external JS and CSS libraries also minified and combined or left as is?

There are several convenient options for .NET, for example:

Chirpy

SquishIt

Cassette

And new in ASP.NET 4.5: Bundling in ASP.NET 4.5

我建议阅读Google的Page Speed及其Closure Compiler Service

I would also add RequestReduce for .net options. It may be the only runtime bundling option for minifying external resources. Its unique from the other .net options in that it grabs the unminified content via http instead of via the file system. It can also sprite your background images.

I know this is an old question but I thought I will give a better answer (trick).

In visual studio if you do format code (Ctrl + K + D) then css will be formatted nicely for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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