1

I have written a web application that uses someone else's API that requires ETags. I have tried this code:

header("ETagbleh: whatever");

Which works perfectly. However, when I set this:

header("ETag: whatever");

Nothing happens. I have heard that it may be Apache blocking the sending of ETags, but I'm not sure. I've done a search for ETag in my apache2.conf and can't find anything to uncomment / remove, so I came here to ask.

So, how can I stop Apache blocking my headers?

Edit: I'm using Apache 2.2.22, and I assumed that the scripting language was irrelevant, given that PHP 5.4.4, which is what I'm using, can set any other header fine.

2
  • can you reference Apache doing this, never herd of it and I to use api's that use ETag.
    – user557846
    Sep 13, 2012 at 20:58
  • 1
    You don't say which apache 1.3,2.0,2.2,2.4 also which script technology is in use (maybe PHP?). Normally for scripting apache does not attempt to do anything, it only usually emits them for static files and .htaccess can include "FileETag None" as per httpd.apache.org/docs/2.2/mod/core.html#fileetag Sep 13, 2012 at 21:05

1 Answer 1

1

I've had the same problem.

A very popular way to remove ETags in Apache2 is adding the following configuration:

Header unset ETag
FileETag None

Remove the first config line, if you find it in your configuration.

A bit more difficult to find is mod_include causing the problem. By default the ETag-Header is removed by this module. But you can allow it by configuration. So add something like this:

 <IfModule mod_include.c>
     SSIETag on
 </IfModule>

See here for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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