0

From a Google Pagespeed Insights test it seems my MediaWiki website lacks text-compression;
reading about this, it seems I lack this because I don't have Gzip compression on.
I Ran this gzip test and it seems indeed my website lacks Gzip compression.

Interpreting this article, I tried to add Gzip by adding to following input to the end of LocalSettings.php:

$wgUseGzip = true;

Yet Gzip wasn't added.

I find no other manual literature about this
How to allow Gzip for a MediaWiki website?

  • $wgUseGzip is specific to using the file cache (as the documentation page tells yout). – Tgr Apr 24 '19 at 3:22
1

You can activate compression using .htaccess file if your server supports it.

Just create a ".htaccess" file on your http root with this contents and run the test again:

<ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy