I am developing a web app with an ASP server side and I use an iframe for data push.
An ASP handler flushes every once in a while some javascript to the iframe:
context.Response.Write("<script language='javascript'>top.update('lala');</script>");
context.Response.Flush();
My problem is that sometimes, when I receive the data, I don’t get the full text.
For example I will receive this : <script language='javascript'>update('lala');</
Unfortunately this prevents the javascript code from being executed if no other data is to come during the next second or so.
One workaround I have is to have a thread flushing ‘……….’ every 500ms. (Then I will receive script>...... which will complete my javascript.)
However I am sure there must be a way to have Response.Flush() sending the whole chunk of data.
Does someone have an idea on how to use properly Response.Flush() ?
Thank you!
Charles
One of my coworkers figured out the problem. Gzip compression was enabled on IIS, which was preventing the web browsers getting full chunks of data.
Among the solutions:
Disable compression for all websites:
For IIS 5.1, go to
Control Panel/Administrative Tools/Internet Information Services. Right click onWeb Sites, click onpropertiesand remove the ISAPI filterCompression.For IIS 7, go to
My Documents/IISExpress/config/applicationHost.configand change the parthttpCompressionso that compression is not enabled for your particular page.Disable compression just for your website:
In the
web.configfile of your application, add the line<urlCompression doStaticCompression="true" doDynamicCompression="false"/>under the section<system.webServer>.Disable compression for a particular web page or a particular request
These good guys found a way to do it:
Can gzip compression be selectively disabled in ASP.NET/IIS 7?