kasey
kasey

Reputation: 553

Can YUI compressor minify ASP.NET inline script?

How can you compress 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.

Upvotes: 4

Views: 2798

Answers (3)

Pure.Krome
Pure.Krome

Reputation: 87087

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).

Upvotes: 5

ChrisLively
ChrisLively

Reputation: 88092

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

This has a similiar effect as regular javascript compression. 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.

Upvotes: 2

Quentin
Quentin

Reputation: 944568

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

If it is generated by ASP.NET components - 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.

Upvotes: 0

Related Questions