title: gzip compression is not working using MEAN STACK and LiteSpeed Server with cPanel access - mod deflate; mod gzip
body: <p>I've been trying to compress my files using gzip but it's not working. I have tested the website on several gzip test sites and some says my website is gzipped but <a href="https://www.giftofspeed.com/gzip-test/" rel="nofollow noreferrer">www.giftofspeed.com/gzip-test/</a> says otherwise and my website</p>
  <p>This is what I currently have in my .htaccess file (not the root file but I have a similar one):</p>
  <pre><code>&gt; RewriteEngine On
  &gt; # If an existing asset or directory is requested go to it as it is RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond
  &gt; %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ - [L] RewriteCond
  &gt; %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [R=200,L]
  &gt; 
  &gt; # If the requested resource doesn't exist, use index.html RewriteRule ^ /index.html
  &gt; 
  &gt; &lt;filesMatch &quot;.(css|jpg|jpeg|png|gif|js|ico)$&quot;&gt; Header set
  &gt; Cache-Control &quot;max-age=2628000, public&quot; &lt;/filesMatch&gt;
  &gt; 
  &gt; &lt;IfModule mod_headers.c&gt;   Header set Access-Control-Allow-Origin &quot;*&quot; 
  &gt; Header always set Access-Control-Allow-Methods &quot;OPTIONS, POST, GET,
  &gt; DELETE, PUT, PATCH&quot;   Header always set Access-Control-Max-Age &quot;86400&quot;
  &gt; Header always set Access-Control-Allow-Headers
  &gt; &quot;append,delete,entries,foreach,get,has,keys,set,values,
  &gt; x-requested-with, Content-Type, origin, authorization, accept,
  &gt; client-security-token, x-auth-token&quot;
  &gt; #   Header always set Content-Length: totalBytes
  &gt; #   Header always set Content-Encoding: gzip &lt;/IfModule&gt;
  &gt; 
  &gt; &lt;IfModule mod_mime.c&gt;  AddType application/x-javascript .js  AddType
  &gt; text/css .css &lt;/IfModule&gt; &lt;IfModule mod_deflate.c&gt;  SetOutputFilter
  &gt; DEFLATE   &lt;IfModule mod_setenvif.c&gt;    SetEnvIfNoCase Request_URI
  &gt; \.(?:rar|zip)$ no-gzip dont-vary    SetEnvIfNoCase Request_URI
  &gt; \.(?:gif|jpg|png)$ no-gzip dont-vary    SetEnvIfNoCase Request_URI
  &gt; \.(?:avi|mov|mp4)$ no-gzip dont-vary    SetEnvIfNoCase Request_URI
  &gt; \.mp3$ no-gzip dont-vary   &lt;/IfModule&gt;  &lt;IfModule mod_headers.c&gt;  
  &gt; Header append Vary User-Agent env=!dont-vary  &lt;/IfModule&gt; &lt;/IfModule&gt;
  &gt; 
  &gt; &lt;IfModule mod_deflate.c&gt; &lt;FilesMatch
  &gt; &quot;\\.(html|php|txt|xml|js|css|htm|jpg|png|jpeg|woff|woff2)$&quot;&gt;
  &gt; SetOutputFilter DEFLATE &lt;/FilesMatch&gt; &lt;/IfModule&gt;
  &gt; 
  &gt; 
  &gt; &lt;IfModule mod_deflate.c&gt;   # Compress HTML, CSS, JavaScript, Text, XML
  &gt; and fonts   AddOutputFilterByType DEFLATE application/javascript  
  &gt; AddOutputFilterByType DEFLATE application/rss+xml  
  &gt; AddOutputFilterByType DEFLATE application/vnd.ms-fontobject  
  &gt; AddOutputFilterByType DEFLATE application/x-font  
  &gt; AddOutputFilterByType DEFLATE application/x-font-opentype  
  &gt; AddOutputFilterByType DEFLATE application/x-font-otf  
  &gt; AddOutputFilterByType DEFLATE application/x-font-truetype  
  &gt; AddOutputFilterByType DEFLATE application/x-font-ttf  
  &gt; AddOutputFilterByType DEFLATE application/x-font-woff  
  &gt; AddOutputFilterByType DEFLATE application/x-font-woff2  
  &gt; AddOutputFilterByType DEFLATE application/x-javascript  
  &gt; AddOutputFilterByType DEFLATE application/xhtml+xml  
  &gt; AddOutputFilterByType DEFLATE application/xml   AddOutputFilterByType
  &gt; DEFLATE font/opentype   AddOutputFilterByType DEFLATE font/otf  
  &gt; AddOutputFilterByType DEFLATE font/ttf   AddOutputFilterByType DEFLATE
  &gt; font/woff   AddOutputFilterByType DEFLATE font/woff2  
  &gt; AddOutputFilterByType DEFLATE image/svg+xml   AddOutputFilterByType
  &gt; DEFLATE image/x-icon   AddOutputFilterByType DEFLATE image/jpeg  
  &gt; AddOutputFilterByType DEFLATE image/png   AddOutputFilterByType
  &gt; DEFLATE image/gif   AddOutputFilterByType DEFLATE image/bmp  
  &gt; AddOutputFilterByType DEFLATE image/jpeg,   AddOutputFilterByType
  &gt; DEFLATE text/css   AddOutputFilterByType DEFLATE text/html  
  &gt; AddOutputFilterByType DEFLATE text/javascript   AddOutputFilterByType
  &gt; DEFLATE text/plain   AddOutputFilterByType DEFLATE text/xml
  &gt; 
  &gt;   # Remove browser bugs (only needed for really old browsers)  
  &gt; BrowserMatch ^Mozilla/4 gzip-only-text/html   BrowserMatch
  &gt; ^Mozilla/4\.0[678] no-gzip   BrowserMatch \bMSIE !no-gzip
  &gt; !gzip-only-text/html   Header append Vary User-Agent
  &gt; 
  &gt; &lt;/IfModule&gt;
  &gt; 
  &gt; # compress text, html, javascript, css, xml:   # Compress HTML, CSS, JavaScript, Text, XML and fonts   AddOutputFilterByType DEFLATE
  &gt; application/javascript   AddOutputFilterByType DEFLATE
  &gt; application/rss+xml   AddOutputFilterByType DEFLATE
  &gt; application/vnd.ms-fontobject   AddOutputFilterByType DEFLATE
  &gt; application/x-font   AddOutputFilterByType DEFLATE
  &gt; application/x-font-opentype   AddOutputFilterByType DEFLATE
  &gt; application/x-font-otf   AddOutputFilterByType DEFLATE
  &gt; application/x-font-truetype   AddOutputFilterByType DEFLATE
  &gt; application/x-font-ttf   AddOutputFilterByType DEFLATE
  &gt; application/x-font-woff   AddOutputFilterByType DEFLATE
  &gt; application/x-font-woff2   AddOutputFilterByType DEFLATE
  &gt; application/x-javascript   AddOutputFilterByType DEFLATE
  &gt; application/xhtml+xml   AddOutputFilterByType DEFLATE application/xml 
  &gt; AddOutputFilterByType DEFLATE font/opentype   AddOutputFilterByType
  &gt; DEFLATE font/otf   AddOutputFilterByType DEFLATE font/ttf  
  &gt; AddOutputFilterByType DEFLATE font/woff   AddOutputFilterByType
  &gt; DEFLATE font/woff2   AddOutputFilterByType DEFLATE image/svg+xml  
  &gt; AddOutputFilterByType DEFLATE image/x-icon   AddOutputFilterByType
  &gt; DEFLATE image/jpeg   AddOutputFilterByType DEFLATE image/png  
  &gt; AddOutputFilterByType DEFLATE image/gif   AddOutputFilterByType
  &gt; DEFLATE image/bmp   AddOutputFilterByType DEFLATE image/jpeg,  
  &gt; AddOutputFilterByType DEFLATE text/css   AddOutputFilterByType DEFLATE
  &gt; text/html   AddOutputFilterByType DEFLATE text/javascript  
  &gt; AddOutputFilterByType DEFLATE text/plain   AddOutputFilterByType
  &gt; DEFLATE text/xml
  &gt; 
  &gt;   # Remove browser bugs (only needed for really old browsers)  
  &gt; BrowserMatch ^Mozilla/4 gzip-only-text/html   BrowserMatch
  &gt; ^Mozilla/4\.0[678] no-gzip   BrowserMatch \bMSIE !no-gzip
  &gt; !gzip-only-text/html   Header append Vary User-Agent
  &gt; 
  &gt; # Or, compress certain file types by extension: &lt;files *.html&gt; SetOutputFilter DEFLATE &lt;/files&gt;
  &gt; # php -- BEGIN cPanel-generated handler, do not edit
  &gt; # Set the “ea-php74” package as the default “PHP” programming language. &lt;IfModule mime_module&gt;   AddHandler
  &gt; application/x-httpd-ea-php74 .php .php7 .phtml &lt;/IfModule&gt;
  &gt; # php -- END cPanel-generated handler, do not edit
  </code></pre>
  <p>I am currently using cPanel. Server is Litespeed. I have enabled zlib.output.compression found in  <code>MultiPHP INI Editor</code>; also selected &quot;Compress All Content&quot; in <code>Compress All Content</code>. I have pretty much tried every solution I can possibly find online but gzip is still not working. I have also contacted my provider and they wanted me to check my code/script but I know my code works because it works locally and on another web hosting provider's site. The issue only arouse after I have changed it to this provider.</p>