admin管理员组

文章数量:1390240

How can you press inline script and style tags?

YSlow says In addition to minifying external scripts and styles, inlined script and style blocks can and should also be minified.

How can you press inline script and style tags?

YSlow says In addition to minifying external scripts and styles, inlined script and style blocks can and should also be minified.

Share Improve this question edited May 22, 2009 at 15:32 Ferdinand Beyer 67.3k17 gold badges159 silver badges147 bronze badges asked May 22, 2009 at 15:23 kaseykasey 5537 silver badges21 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

Don't forget that there's a .NET port of YUI Compressor. :)

You can use it for post-build events or in a TFS build or just use the dll's in your own project(s).

You might look into MBCompression It allows you to press pretty much everything ing out of a app (including those lovely webresource.axd files).

This has a similiar effect as regular javascript pression. Beyond that, i'd still look into pulling out the inline scripts into separate files in order to remove duplication and allow the browser to cache that data.

It is just text. Remove it from the HTML surrounding it, run it through the YUI pressor, then put it back.

If it is generated by ASP.NET ponents - then you'd probably have to intercept it on the way out of ASP (e.g. with a proxy), and at that point is almost certainly isn't worth the effort.

本文标签: javascriptCan YUI compressor minify ASPNET inline scriptStack Overflow