Mobile app version of vmapp.org
Login or Join
Sarah324

: How to best enable gzip compression on shared hosting I must assume that this is a duplicate question, but I could not find the answer myself. I want to enable gzip compression to everything

@Sarah324

Posted in: #Gzip #Htaccess #Php

I must assume that this is a duplicate question, but I could not find the answer myself.
I want to enable gzip compression to everything my website sends (mostly php, css, a slight bit of js).

this question makes a point of adding a line into the .htaccess file (that i do have access to) but i'm not sure if that would include the dynamic content.

this question (has a typo in the question, it should be ob_start I think) tells me how to enable gzip to php files. and after fixing the typo it seems to work.

do i need to use both ? is there anything else i need as well ?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah324

1 Comments

Sorted by latest first Latest Oldest Best

 

@Pope3001725

The output of PHP files is HTML. That HTML will be compressed using the code in this question:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/javascript application/json


That's all you need to do (assuming mod_deflate is enabled for Apache).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme