Serving gz files
Posted by: ajk99 (---.upc-f.chello.nl)
Date: March 03, 2007 01:24PM

I'm trying to serve zipped javascript files (with a .js.gz extension) through WAMP but they're not being unzipped. Do I need to change the configuration settings?

Thanks for newbie level advice.

Options: ReplyQuote
Re: Serving gz files
Posted by: CyberSpatium (71.237.217.---)
Date: March 03, 2007 02:10PM

there are two ways you can do this. the easiest way is to just create an .htaccess file instead of having to edit a config file:

.htaccess file:

<files *.js.gz>
AddType "text/javascript" .gz
AddEncoding gzip .gz
</files>


make sure you save that file as .htaccess and remember to include the dot ( . ) before the name htaccess.

if you do not want to use .htaccess file, then you can edit your httpd.conf file ( C:\wamp\Apache2\conf\httpd.conf )

find:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3


change to:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType text/javascript .gz


find:
#AddEncoding x-gzip .gz .tgz

remove the # at the beginning of the line to enable this setting:
AddEncoding x-gzip .gz .tgz

now restart apache to make the new settings take effect.


CyberSpatium
----------------------------
Wamp English Forum Admin

Options: ReplyQuote
Re: Serving gz files
Posted by: ajk99 (---.upc-f.chello.nl)
Date: March 03, 2007 03:52PM

Thanks for the advice. I did it with your changes to the httpd.conf file.

Options: ReplyQuote
Re: Serving gz files
Posted by: ajk99 (---.upc-f.chello.nl)
Date: March 05, 2007 11:05AM

This works fine with Firefox but IE 7 still doesn't recognise the filetype. Is there anything else I need to do?
Andrew

Options: ReplyQuote
Re: Serving gz files
Posted by: CyberSpatium (71.237.217.---)
Date: March 10, 2007 11:04PM

dunno... works for me with FF 2.0.0.0 for OpenSuse linux, and FF 2.0.0.2 and IE 7.0.5730.11 for windows. try checking your internet explorer settings.


CyberSpatium
----------------------
WAMP English Forum Admin

Options: ReplyQuote
Re: Serving gz files
Posted by: ajk99 (---.upc-f.chello.nl)
Date: March 11, 2007 01:33PM

Cyberspatium - thanks for following up. I think it is something to do with local settings though haven't got to the bottom of it yet.

Options: ReplyQuote


Sorry, only registered users may post in this forum.