« Previous Next »

Thread: GZip Compression not working on some Javascript files

Last post 10-05-2008 7:50 PM by ksingla. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-05-2008, 5:43 PM

    • rstrahl
    • Top 150 Contributor
    • Joined on 08-20-2003, 1:08 PM
    • Paia, Hawaii
    • Posts 45

    GZip Compression not working on some Javascript files

    I've been having problems AGAIN with IIS and compression this time on IIS 7. On both my local dev machine and my live server I'm noticing that only some of my script files are showing up in the GZIP temp directory.

    Specifically I'm using a pair of script files that are almost always used in combination but only one of the two is getting compressed apparently.

    The scripts are loaded out of a virtual ~/scripts/ and the two files are jQuery.js and ww.jquery.min.js. jQuery.min.js shows up in the compressed folder, ww.jquery.js does not. Both are getting loaded in tandem as static resources typically so the usage pattern should be nearly identical.

    I also see the non-min files compressed so both jQuery.js and ww.jquery.js are showing up, but the ww.jquery.min.js does not.

    I'm guessing this is some sort of restriction based on the file segments and wonder if somebody could shed any light on why this particular file is not compressing.

    Rick Strahl [MVP]
    West Wind Technologies
    Making waves on the Web
    www.west-wind.com/weblog
  • 10-05-2008, 7:50 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 863

    Re: GZip Compression not working on some Javascript files

    Do you get a compressed response if you send request to www.jquery.js directly with Accept-Encoding: gzip header? One possibility is that file size of this file is small and you are running into minFileSizeForComp (default is 256 bytes). If you are not seeing compressed response to the file and minFileSizeForComp is not the reason, try turning on freb tracing and see why compression didn't happen in the log.

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
Page 1 of 1 (2 items)
Microsoft Communities