2

My old server is running Apache 2.2. It has mod_deflate enabled. It was a pretty easy setup, you just un-comment the LoadModule line, and then add the following:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript application/javascript text/css application/xml image/svg+xml

But now I'm setting up a new server running Apache 2.4 This isn't working in 2.4 and I'm not sure why. Everything seems to be enabled and configured correctly.

BUT I also read that using AddOutputFilterByType is deprecated anyway. So, what are the alternate/better ways to enable this on-the-fly compression? I suppose if I could easily enable based on file extension, that would work just as good.

l008com
  • 1,699
  • 2
  • 11
  • 20
  • Turns out compression was working, but the doc I was testing on actually throws its own 404 status using PHP (for a good but unrelated reason), and apparently adding headers in PHP stops the compression. But that's fine. So everything is working normally. – l008com Mar 26 '18 at 00:32

1 Answers1

4

There's no problem with this directive in 2.4, you should just use the convenient form. Using mod_filter directly is quite challenging.

The 2.4 manual says "Had severe limitations before being moved to mod_filter in version 2.3.7"

covener
  • 17,402
  • 2
  • 31
  • 45