Jan 10 2007

Overriding packing

Posted by admin under ASPCodeHeaderManager

You can for a certain script/css file set the maximum level compression to ever be used for it. For example you might have found that from all your 100 js files there is one file - foobar.js which doesn't work when packed. But it does work when whitespace removed.

You can still use IncludeScriptsCompression=2 (I do recommend it as a matter of fact) - but you can then override the maxlevel for that specific file:

<headermanager:IncludeScript Path="~/scripts/foobar.js" HighestCompressionLevel="1" />

now all files will be packed level 2 - except that file.

Or of course

<headermanager:IncludeScript Path="~/scripts/foobar.js" HighestCompressionLevel="0" />

will not touch the file at all.

There is also another way. Say you managed to (by hand) create a packed and obfuscated file for foobar.js. Jou call it foobar.pack.js and now you can use:

<headermanager:IncludeScript Path="~/scripts/foobar.js" StaticPathLevel2="~/scripts/foobar.pack.js" />

Which means that when level 2 packing is asked for - then a static URL to the foobar.pack.js will be used instead.