works in IE (windows), and FF,Opera on linux. for the versions i have--but you're right it may not work in all cases. <br><br>according to PHP.net, the ob_gzhandler sends non-compressed js if the browser can not handle gzip. i haven't been able to find any info on when it doesn't work, only that it 'might not work' in some browsers...
<br><br>i'm not root on most machines that i have ka-map apps on, so it seems a good alternative when you cant get mod_gzip or the like installed at will. <br>-b<br> <br><div><span class="gmail_quote">On 3/6/06, <b class="gmail_sendername">
Paul Ramsey</b> <<a href="mailto:pramsey@refractions.net">pramsey@refractions.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Make sure you test this well across multiple platforms before you<br>implement. Some browsers are happy to accept gzip encoded HTML, but<br>croak when handed .js or .css gzipped.<br>P<br><br>On Mar 6, 2006, at 8:48 AM, David Bitner wrote:
<br><br>> I've used this PHP method succesfully with other js for quite a while.<br>> Another option in Apache is to use mod_gzip or mod_deflate to<br>> compress all html,js, and css that goes through the webserver.
<br>><br>> On 3/6/06, Brent Pedersen <<a href="mailto:bpederse@gmail.com">bpederse@gmail.com</a>> wrote:<br>>> hi, just saw this use of php that seems especially applicable to<br>>> ka-map<br>>> javascript.
<br>>> you can get php to gzip .js (or .css) files for you. this seems to be<br>>> working pretty well. (see code below.) it gets it down to a single<br>>> request<br>>> of 27K instead of 8 requests totalling > 130K.
<br>>><br>>> -brent<br>>><br>>><br>>> <?php<br>>> ob_start ("ob_gzhandler");<br>>> header("Content-type: text/javascript; charset: UTF-8");<br>>> header("Cache-Control: must-revalidate");
<br>>> $days = 30;<br>>> $offset = 60 * 60 * 24 * $days;<br>>> $ExpStr = "Expires: " .<br>>> gmdate("D, d M Y H:i:s",<br>>> time() + $offset) . " GMT";<br>>> header($ExpStr);
<br>>><br>>> $files = array("DHTMLapi.js", "xhr.js", "jsExpander.js ", "kaMap.js",<br>>> "kaTool.js", "startUp.js", "extra.js","
testExtents.js");<br>>><br>>> foreach ($files as $fi){<br>>> print file_get_contents($fi);<br>>> }<br>>><br>>> ?><br>>><br>>><br>>> _______________________________________________
<br>>> ka-Map-users mailing list<br>>> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>>> <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">http://lists.maptools.org/mailman/listinfo/ka-map-users
</a><br>>><br>>><br>>><br>><br>> _______________________________________________<br>> ka-Map-users mailing list<br>> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org
</a><br>> <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br><br></blockquote></div><br>