1

On a Debian Jessie installation, I manually installed wordpress and edited .htaccess, turning mod_expires on:

ExpiresActive On
ExpiresDefault modification

However, when I use Firefox Inspector to watch network traffic, I find all the js and css files return 200 OK with gzip-compressed content instead of HTTP 304.

Then I did some experiment.

  1. I created an almost empty (incompressible) file named foobar.css and browse it in firefox. It returned 200 OK with uncompressed data on the first time and 304 Not Modified the second time.
  2. I repeated the same content several times to create a large (compressible) file. This time the server returned 200 OK with compressed data on the first time, the second time, the third time... Every time it returns the same content instead of the expected 304 Not Modified.

I watched /etc/apache2/mods-enabled/deflate.conf and found that text/css is deflated by default:

...
AddOutputFilterByType DEFLATE text/css
...

Can the two modules mod_expires and mod_deflate work at the same time? How should I configure them?

Terribly sorry for broken English.

EDIT: I have found a workaround here: https://bz.apache.org/bugzilla/show_bug.cgi?id=45023#c22 However, it is only a workaround. I think it's really a server bug.

Lv Zheng
  • 131
  • 2

1 Answers1

0

I have found a workaround here: https://bz.apache.org/bugzilla/show_bug.cgi?id=45023#c22

Just put the following line in .htaccess or httpd configuration file:

RequestHeader edit "If-None-Match" '^"((.*)-gzip)"$' '"$1", "$2"'

Dirty, but effective. ;)

Lv Zheng
  • 131
  • 2