My Magento site is running on a VPS with
Server version: Apache/2.4.23 (Unix)
PHP Version => 5.5.38
The following optimization in place:
Merge JS/CSS
Magento compilation
Redis Server
Opcache
lesti FPC
Mod_Pagespeed
My site is quick enough https://gtmetrix.com/reports/www.modmybike.in/fdHza8gN but my ttfb is quite high and I want to reduce the TTFB. I am ready to sacrifice the under 2 sec page load speed for quicker connection and TTFB.
I believe the TTFB is high due to Gzip compression.
I have tried to remove the Apache Gzip compression by trying the following methods.
- Removed the text/html mime type from AddOutputFilterByType DEFLATE in .htaccess
- SetEnvIf Request_URI "(/)" no-gzip dont-vary in .htaccess
- Disabled mod_deflate entirely in .htaccess
- Moved from using .htaccess to httpd.conf and explicitly set "SetEnv no-gzip 1"
- Removed compress in Lesti::FPC
- Compression not enabled in Mod_Pagespeed.
Even with all the above attempts the Accept Encoding is still set to 'gzip, deflate'. I have been on this from last 2 weeks without any progress.
My only option i can think of is to rebuild Apache without mod_deflate.
Edit : Commented out #LoadModule mod_deflate in httpd.conf.
httpd -M still lists mod_defalte as a loaded module after restart.
Please help.
Best Answer
Accept Encoding
is a request header. This comes from your browser to the server telling the server that this browser will accept the gzip or deflate compression. If the server does compress the resource it will respond withContent-Encoding: gzip
.I am doubtful that you will gain any speed-up with disabling gzip as it is very fast.
However, as this it is hard to tell exactly how to do this since I do not know whether you have only one web server, or a proxy as well which may be introducing compression, and what you actual configuration is...
It looks like you've already done some of this but here's what you should look at:
In general it seems that if you disable mod_deflate in httpd.conf you should be good, as is outlined here: https://scottlinux.com/2012/09/13/disable-http-compression-in-apache/
Hope this helps :)