0
votes

I have Install Gzip code in my .htaccess file also enable it from options.php but it not showing effect. I have check in inspect element -> network

but there is no any encoding type How can I enble it. Following is my .htaccess code:

# Compress HTML, CSS, JavaScript, Text, XML and fonts AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html Header append Vary User-Agent

2

2 Answers

0
votes

if your website is on live server you can check if Gzip compression is on/off online using this website http://checkgzipcompression.com/

OR

To check in chrome, Open Developer Tools by pressing F12.

  • Go to network tab.
  • Reload the page, so that it can capture the all request.
  • Find the response header Content-Encoding: gzip
0
votes

What is Gzip?

GZIP compression is bundling (zipping) pages on a web server before the page is sent to the visitor. This saves bandwidth and therefore increases the loading speed of the page significantly. The visitors' web browser then automatically unzips the pages.

Enable Via Plugin

https://wordpress.org/plugins/check-and-enable-gzip-compression/

Reason for not working

  • Run on diffrent Server
    • Enable compression on NGINX webservers
    • Enable compression on Apache webservers
    • Enable compression on Litespeed webservers

Referance link:

https://varvy.com/pagespeed/enable-compression.html

Edited (I am achive compression using following code)

    AddOutputFilterByType DEFLATE text/plain #content encoding Speed
        AddOutputFilterByType DEFLATE text/html #content encoding Speed
        AddOutputFilterByType DEFLATE text/xml #content encoding Speed
        AddOutputFilterByType DEFLATE text/css #content encoding Speed
        AddOutputFilterByType DEFLATE application/xml #content encoding Speed
        AddOutputFilterByType DEFLATE application/xhtml+xml #content encoding Speed
        AddOutputFilterByType DEFLATE application/rss+xml #content encoding Speed
        AddOutputFilterByType DEFLATE application/javascript #content encoding Speed
        AddOutputFilterByType DEFLATE application/x-javascript #content encoding Speed
        AddType x-font/otf .otf #content encoding Speed
        AddType x-font/ttf .ttf #content encoding Speed
        AddType x-font/eot .eot #content encoding Speed
        AddType x-font/woff .woff #content encoding Speed
        AddType image/x-icon .ico #content encoding Speed
        AddType image/png .png #content encoding Speed
        # content encoding Speed -- Ends here