About the author

Miron Abramson
Software Engineer,
CTO at PixeliT
and .NET addicted for long time.
Open source projects:
MbCompression - Compression library

Recent comments



The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2018

Creative Commons License

Blog Flux Directory
Technology Blogs - Blog Top Sites

Update to my compression module to compress third party scripts

My last version of the compression module was working great and able to compress and cache pages, WebResources, CSS and JavaScripts files. It have one problem (that similiar to most of the compression modules you can find). To compress the javascripts files, you have to modify the way you register them and change their links to something like that: 

<script type="text/javascript" src="/Scripts/utils.js">

needs to became 

<script type="text/javascript" src="Scripts/jslib.axd?d=~/Scripts/utils.js">

It is not so hard work to do, but it became useless when you use third party controls as 'Telerik' (RadControls)  and force it to doesn't use it's scripts as WebResources. In such case, the controls 'Injects' their scripts links into the HTML code and you can't modify them as needed to let the compression handler to compress it.  In the new version of my compression component, I added a ResponseFilter that parse the Scripts links in the HTML and convert them into 'compressable' links. By default, this option is disabled in the compression module. To enable it (if you use such third party controls), just add the attribute compressThirdParityScripts="true" to the compression configuration.

Full implementation instructions can be found here: Compression module implementation 

Latest code can be downloaded from: http://www.codeplex.com/MbCompression

Currently rated 4.8 by 5 people

  • Currently 4.8/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by Miron on Friday, February 22, 2008 4:15 AM
Permalink | Comments (7) | Post RSSRSS comment feed

Related posts



Friday, February 22, 2008 5:12 AM


Trackback from DotNetKicks.com

Update to my compression module to compress also third party scripts

matt jackson au

Monday, May 05, 2008 10:51 PM

matt jackson

Can I make use of this module if I define external scripts using the AJAX script manager?

Miron il

Wednesday, May 07, 2008 1:48 PM


Sure you can use my compression component when using the AJAX script manager, but if your intention is to compress the MS-Ajax's script files (ScriptResource.axd), so there is no need cause they are been compressed automatically.
Also note that the Ajax callbacks can't been compressed. You can still my compressor to compress the whole page, other js files, css and WebResources.

Yovav us

Wednesday, January 28, 2009 1:41 AM


The following HTTP Compression Module lets you compress based on MIME types:



ed hardy cn

Monday, April 26, 2010 1:18 PM

ed hardy

Thank you for the information

Quebec Business Plans gb

Friday, May 14, 2010 5:09 PM

Quebec Business Plans

I am impressed by your knowledge on this topic.I hope to learn a lot form you on this subject.

Designer handbags us

Sunday, May 23, 2010 7:58 PM

Designer handbags

Also note that the Ajax callbacks can't been compressed. You can still my compressor to compress the whole page, other js files, css and WebResources.