an unknown filter was not added: DEFLATE

February 27th, 2008 | by David |

I looked in Apache’s error_log file and noticed multiple lines like this:

an unknown filter was not added: DEFLATE

After thinking a bit I recalled that I added the following line in the .htaccess file in the root directory for on one of my domains, but never tested it properly:

AddOutputFilterByType DEFLATE text/html text/plain text/xml

The fix is easy: enable mod_deflate. On Ubuntu:

$ sudo a2enmod deflate
Module deflate installed; run /etc/init.d/apache2 force-reload to enable.
$ sudo /etc/init.d/apache2 force-reload
* Forcing reload of apache 2.0 web server...

Why did I add the above filter line in the first place? It was suggested by YSlow.

Update Another kind of fix is of course to remove AddOutputFilterByType.

  1. 4 Responses to “an unknown filter was not added: DEFLATE”

  2. By gavin on Feb 29, 2008 | Reply

    Thank you, this helps a lot.

  3. By php trivandrum on Oct 23, 2008 | Reply

    Thanks a ton!

    It saved my life

  4. By paddo on Dec 30, 2008 | Reply

    Thanks!

  5. By ronny stalker on Sep 25, 2009 | Reply

    oh…my code did not appear in the last message…trying again…

    Thanks – i was in exactly same situation
    I read the YSlow book and forgot to add the mod_deflate.c after moving to a new server.

    Just another alternative fix…wrap that line within :

    (open bracket) IfModule mod_deflate.c (close bracket)

    like so:

    (open bracket) IfModule mod_deflate.c (close bracket)

    #Compress everything except images -note some images have the .php extension -start

    ..stuff that was to do with deflating…

    #Compress everything except images -end
    (open bracket)/IfModule(close bracket)

    This means you can stave the problem if the site migrates.

Post a Comment