Ubuntu 14.04 Apache 2.4.7 php-FPM 5.5.9

Using latest stable Pagespeed Module for Apache (

I'm in the process of optimizing a WordPress website for speed (bandwidth and rendering). Mod Deflate is set up. A plugin (Better Wordpress Minify) compresses and combines all css files into one (thus reducing the number of requests). With Pagespeed switched off, if I check the produced link (using FeedTheBot) it confirms that the content is compressed using gzip. But If Pagespeed is switched on, it shows Gzip is not working. Using PageSpeed Insight (chrome extension) confirms this.

Here is what I've tried:

  • Adding to /etc/apache2/mods-available/pagespeed.conf ModPagespeedFetchWithGzip on SetOutputFilter DEFLATE
  • check that mod Deflate is available and enabled (it appears in the list produced by apache2ctl -t -D DUMP_MODULES). The fact that if pagespeed is switched off, it works for the combined css file is another proof.

Do you have an explanation ?

  • I suggest using WordPress plugin WP Super Cache – newmusic Dec 2 '18 at 13:07

This is the way to enable mod_deflate for html,xml,js,css,php files :

SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript application/x-httpd-php
DeflateCompressionLevel 9

# This part is optional, it is used for really old browser >

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.