Can I override / exclude the header field of the HTTP response with a PHP script so that the field is not set?

If the server automatically sends a default HTTP expiration header response, can I override the / null that came out with php script so that the Expires header field is not set?

+4
source share
2 answers

Yes, you can. This will override any previously defined Expires header:

 header ('Expires:');

It will only work if the headers are not already sent, so before you repeat something, and PHP will start sending data to the browser. You may need to use output buffering.

And when upgrading to PHP 5.3. * you can also use header_remove('Expires'); .

+1
source

The answer containing the default Expires header depends on whether you use sessions (and how, see session_cache_limiter )

In any case, if so, you can override it, and you can delete it with header_remove (I have not tested it).

0
source

All Articles