Forum Moderators: open

Message Too Old, No Replies

Javascript Ajax vs dynamic compression

javascript ajax

         

phronima

4:40 am on Feb 26, 2010 (gmt 0)

10+ Year Member



I have java/ajax function that worked fine until I turned on dynamic compression on IIS6.0. It's a very simple function by creating a XMLHttpRequest. The request.readystate is 4 and reponse.status is 200, but my responseText and responseXML are now empty with dynamic compression. Without it, it works with absolutely no problems, so I am stumped.

Would any one happen to have had similiar experience before?

whoisgregg

6:23 pm on Mar 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, phronima!

Unfortunately, I don't have any specific experience in this area. However, there should be some way to turn off dynamic compression for certain scripts/pages/resource types. Could a solution be to simply not use compression on files accessed via AJAX?

vol7ron

7:15 pm on Mar 5, 2010 (gmt 0)

10+ Year Member



Check if there is a Content-Length header; the ajax call might need it.

phronima

12:44 am on Mar 8, 2010 (gmt 0)

10+ Year Member



Thanks all, i found a hack to fix this
Basically, my ajax function was calling response.close() at the end of the function. This, combined with dynamic compression resulted in the curious problem i described above. If i take out response.close() i was able to have my ajax functions working again.

By the way i made a faux pas in my post - it should have been javaSCRIPT/Ajax not java/ajax. my bad.

Whoisgregg - I don't know how to explicitly tell IIS which files not to compress as the ajax functions are in aspx files. The .aspx extension is the the bulk of the files that i would like dynamic compression to work on

I don't know what caused the problem, but i found a way to bypass it. If anyone knows why the it happened in the first place i'd be interested to know.

TIA

whoisgregg

10:28 pm on Mar 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know anything about IIS servers, so unfortunately I can't be of too much assistance. However, a bit of searching turned up this page [msdn.microsoft.com] which gives a means of turning off compression (
 doDynamicCompression="false"
) and (I think) it says that this configuration could be at the level of a Web Directory. So you might be able to turn off web compression for a particular directory and serve your javascript out of there.

My IIS knowledge is nil, so I may have completely misread that documentation though. :/

HTH