mod_deflate for jpg png css javascript?

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,488
Points
63
Hi there,

I tried this mod_deflate on my server as some hosting tutorials suggested.

Code:
<Directory /home/*/htdocs>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/x-javascript
</Directory>
But I am not sure it will compress the HTML, css and xml for my websites or not. Is there a way to check this or better code to compress all static files on my website?
I heard it can be done by enable gzip mod but I am not about that.
Any advice?
 

mobin

Well-known member
Registered
Joined
Jun 22, 2017
Messages
234
Points
28
Hi there,

I tried this mod_deflate on my server as some hosting tutorials suggested.

Code:
<Directory /home/*/htdocs>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/x-javascript
</Directory>
But I am not sure it will compress the HTML, css and xml for my websites or not. Is there a way to check this or better code to compress all static files on my website?
I heard it can be done by enable gzip mod but I am not about that.
Any advice?
Ye, you can check the functioning of mod_deflate quite easily. Go to http://www.whatsmyip.org/http-compression-test/ and check your website; if its showing the website is serving with compressed contents then you are good. There are few more websites you can find in INTERNET serving similar kind of things [ like google developer tools ].

Side note :- mod_gzip is old module for Apache, which is replaced by mod_deflate.
 

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,488
Points
63
@mobin

The tool didn't work

gzip-test.png

Also, you didn't read my question, I am asking my codes above are right codes to compress the HTML, css and xml for my websites?
and what about gzip mod, it can be enabled from hosting control panel without using codes?
 

mobin

Well-known member
Registered
Joined
Jun 22, 2017
Messages
234
Points
28
Hello David, I am sorry to hear that the link didn't work for you. But it is working for me still; might be a temporary error at their side when you tried or your server blocked their access. Either way you can check https://gtmetrix.com/enable-gzip-compression.html also to verify your website; in the result set check for "Enable gzip compression" output. if its showing green, you should be fine.

>> I am asking my codes above are right codes to compress the HTML, css and xml for my websites?
It looks good, but you should mind the "Directory" specification. may be something like following is more generic.

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
>>and what about gzip mod
mod_gzip is old module for Apache, which is replaced by mod_deflate. So if you have mod_deflate enabled in your Apache server, your gzip compression should work fine.

>>it can be enabled from hosting control panel without using codes?
If you are using cPanel, go to cPanel >> Software >> Optimize Website and configure your options there. You can either go with compress or with specific MIME type.
 

Laurence Flynn

Well-known member
Registered
Joined
Dec 31, 2016
Messages
92
Points
8
If you run a hosting company you should be compressing data at the server level so just turn it on server wide. Very easy to do. These days you need to be ensuring your client's websites are running as fast as possible.
 

David Beroff

Well-known member
Registered
Joined
Jun 14, 2016
Messages
1,488
Points
63
David Beroff
I don't run a hosting company but I need compress data for my websites before sending them to visitors. I enabled Optimize data in cPanel and using Cloudflare CDN.
Is that enough to keep website fast as which you are talking about? or I need to install somethings to make my server and websites run faster.
 

mobin

Well-known member
Registered
Joined
Jun 22, 2017
Messages
234
Points
28
mobin
That shouldbe fine! Alongtime make sure to adjust the "Expire" time for your static files from the CDN dashboard. Put highest possible TTL value for the static files based on how often you will have a change [ hight possible is recommended, but choose the best values for your fit to avoid frequent invalidations ].
 
Recommended Threads
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top