Forum Moderators: phranque

Message Too Old, No Replies

Test gzip

         

damiantaylor

5:56 pm on Apr 7, 2010 (gmt 0)

10+ Year Member



Is there a way to check if my javascript files are being served gzipped?

I have followed a post that explains how to do it but when I test my site through this tool:
[websiteoptimization.com...]

It tells me I could compress the files. As far as I know, I have!

The method I've used is in my javascript folder I have the following .htaccess file

AddHandler application/x-httpd-php .css
php_value auto_prepend_file gzip-js.php
php_flag zlib.output_compression On


I also have the following file named gzip-js.php

<?php
ob_start ("ob_gzhandler");
header("Content-type: text/javascript; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>


Should this work, and if so how can I test it?

Thanks!

damiantaylor

5:59 pm on Apr 7, 2010 (gmt 0)

10+ Year Member



Sorry, that .htaccess file should read

AddHandler application/x-httpd-php .js
php_value auto_prepend_file gzip-js.php
php_flag zlib.output_compression On