Apache ignores PHP headers when sending 304

When I set a custom header in Apache + mod_php5, this works fine:

header('Foo: Bar');

But when I try to do this, also sending a 304 Not Modified response, the header seems to be removed by apache (along with X-Powered-By and other standard headers).

header('HTTP/1.1 304 No Content');
header('Foo: Bar');

Does anyone know how to solve this problem?

+5
source share
3 answers

Does this not answer the question?

GET (. 13.3.3), . (.. GET ), ; .

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5

+3

Apache 2.4.23 ( , ), 304 "Not Modified", , , Apache - :

http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.23/modules/http/http_filters.c?view=markup#l1331

, ( , CORS Apache 304), , Apache RFC, , , .

Apache (), . , , nginx .

, , , , WebGL , , CORS 304 , 200 OK .

+2

Try:

header('Foo: bar', true, 304);
0

All Articles