Enable gzip compression in Zend CE

General discussion for the Zend Server CE

Enable gzip compression in Zend CE

Postby zohaib82 on Wed May 30, 2012 8:57 am

Hi,

I want to enable gzip compression in Zend CE.

I am using Zend CE on windows (WIN 7 and Win Server 2003 R2).

Please guide regarding configuration in Zend CE.

When I have added following in my php page then I am getting error .
Code: Select all
header("Content-Encoding: gzip");


Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.


Thanks & Regards
Zohaib.
zohaib82
 
Posts: 6
Joined: Wed Dec 15, 2010 2:38 pm

Re: Enable gzip compression in Zend CE

Postby zohaib82 on Wed May 30, 2012 9:50 am

Hi Guys ,

I got the solution

Enable gzip compression on Zend CE

[1]. Open File Zend\Apache2\conf\httpd.conf file.

uncomment following line

LoadModule deflate_module modules/mod_deflate.so

[2]. find following in Zend\Apache2\conf\httpd.conf file.

#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz

and add at the end tag

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
# Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

AddOutputFilterByType DEFLATE application/x-amf

LoadModule deflate_module modules/mod_deflate.so

<Location />
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/xml application/xml application/x-amf
</IfModule>
</Location>

[3]. restart server

Check using Firefox addon Firebug

Content-Encoding : gzip

Thanks & Regards
Zohaib.
zohaib82
 
Posts: 6
Joined: Wed Dec 15, 2010 2:38 pm


Return to Zend Server Community Edition

Who is online

Users browsing this forum: No registered users and 0 guests