Implement gz support
We need to give the users the option to serve gzip compressed content if the browser supports it.
An article on how the gzip compression works (how to make the webserver do it).
An article on how to gzip compress your content from PHP (that means not having Apache (the web server) do it for you). ...and one more.
Reference to the apache_get_modules PHP function to discover if the Apache server has the mod_deflate active.
Sample htaccess conditional directive for gzip'ing content from this article:
An article on how the gzip compression works (how to make the webserver do it).
An article on how to gzip compress your content from PHP (that means not having Apache (the web server) do it for you). ...and one more.
Reference to the apache_get_modules PHP function to discover if the Apache server has the mod_deflate active.
Sample htaccess conditional directive for gzip'ing content from this article:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
Leave a comment
It's worth noting that there are a number of ways of implementing gzip compression and mod_deflate is not always installed and gzip compression in this way may not be supported.
Also, I believe 'AddOutputFilterByType' was deprecated around Apache 2.1, on versions later than 2.1 you would need :
<IfModule mod_deflate.c>
AddOutputFilter DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
On my servers I use :
<IfModule mod_deflate.c>
<FilesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
Which accomplishes much the same thing as your code.
However, on someone else's site mod_deflate wasn't installed and I had to use zlib for text/html and force gzip via php for css and js files.
Also, I believe 'AddOutputFilterByType' was deprecated around Apache 2.1, on versions later than 2.1 you would need :
<IfModule mod_deflate.c>
AddOutputFilter DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
On my servers I use :
<IfModule mod_deflate.c>
<FilesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
Which accomplishes much the same thing as your code.
However, on someone else's site mod_deflate wasn't installed and I had to use zlib for text/html and force gzip via php for css and js files.
on 2010-12-04 16:06 *
By
Assigned to set to petsagouris
Milestone changed from Backlog to 1.5 - current
(In revision:2282) [Branch 1.5] Adding gzip compression. test #180