On Thu, Mar 5, 2009 at 12:34 PM, Jsbeginner <jsbeginner@xxxxxxxxxxxxxx> wrote: > Thankyou, > > I took "application/x-javascript" directly from the apache setup for my > domain so this should be correct. > > However I've just deactivated gzip (zlib.output_compression OFF in php.ini) > and that stopped the problem. > I've given you a simplified version of the script that has the exact same > problem (the original one gets the mime type automaticaly and has the same > problem with any files that are gziped (css, html, javascript etc... but not > images.). > > So the problem seems to have someting to do with this line : > >> header('Content-Length: '.filesize('test.js')); > > and with gzip ... > > I would like to be able to activate gzip again but I need to work out why > I'm getting this bug first. > > Apache isn't installed with mod_deflate, should I look into doing this > instead of turning zlib.output_compression on again ? > > Is there maybe a bug with PHP 5.2.9 that's causing this problem? > > Thankyou :) > > haliphax a écrit : If you use gzip'd output, does PHP automatically generate a Content-Length header? It seems to me that the value for Content-Length should be the compressed size, not the uncompressed size that you are sending. Besides - do you really need to send Content-Length? I don't usually see it sent, and the only time I've seen it make a difference is if I'm sending the file as an attachment (prompting the browser to save the file rather than displaying it). If removing the line eliminates the problem, I'd just remove the line and be done with it. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php