How to Enable GZIP Compression in cPanel?


GZIP compression reduces the size of files sent from your server to the visitor's browser, resulting in faster page load times and reduced bandwidth usage. It can typically reduce HTML, CSS, and JavaScript file sizes by 60–80%.

Method 1: Enable via cPanel Optimize Website

  1. Login to cPanel.
  2. Under Software, click Optimize Website.
  3. Select Compress All Content to enable GZIP for all file types.
  4. Or select Compress the specified MIME types to choose specific file types.
  5. Click Update Settings.

Method 2: Enable via .htaccess

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml
  AddOutputFilterByType DEFLATE text/css text/javascript
  AddOutputFilterByType DEFLATE application/javascript application/x-javascript
  AddOutputFilterByType DEFLATE application/json application/xml
</IfModule>

Testing GZIP Compression

After enabling, verify GZIP is working using free tools:

Tip: GZIP compression works best on text-based files. Images (JPG, PNG) and already-compressed files (ZIP, PDF) do not benefit significantly from GZIP and can sometimes increase in size if compressed again.

If you continue to face issues, please open a create a request.

?האם התשובה שקיבלתם הייתה מועילה 0 משתמשים שמצאו מאמר זה מועיל (0 הצבעות)