Aller au contenu

Enabling data compression using the mod_deflate module

Ce contenu n’est pas encore disponible dans votre langue.

The mod_deflate module in Apache allows you to compress output before sending it to client browsers. On ruachost.com, enabling compression reduces page load times and bandwidth usage, improving overall site performance.

  • Speeds up website loading by reducing file sizes.
  • Saves bandwidth costs.
  • Improves SEO rankings (Google favors faster sites).
  • Works seamlessly with most modern browsers.
  1. Log in to cPanel.

  2. Go to Software → Optimize Website.

  3. Under Compress Content, choose one of the following:

    • Compress All Content – compresses everything.
    • Compress Specified MIME Types – compresses only certain file types.
  4. Click Update Settings.

  5. Test compression using tools like GiftOfSpeed Gzip Test.

Edit your .htaccess file to enable compression.

<IfModule mod_deflate.c>
<FilesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>
  • This compresses HTML, CSS, JavaScript, XML, and plain text files.
  • To disable compression, comment out or remove the relevant lines.
  1. Visit GiftOfSpeed Gzip Test.
  2. Enter your domain name.
  3. The tool will confirm whether compression is active.

Cette page vous a-t-elle aidé ?