Mar 31, 2012
tom

Sending HTTP headers by webserver or PHP?

Question

It is equally possible to send HTTP headers by webserver or script. I use PHP on Nginx. Is there any different to send HTTP headers (such as Cache-Control) by nginx or PHP?

Is it faster to send headers by webserver? and does it have an effect on earlier processing the HTTP request?

Asked by Ali

Answer

Is there any different to send HTTP headers (such as Cache-Control) by nginx or PHP?

Nope, nginx may overwrite (or duplicate headers sent by your application level (PHP using PHP-FPM I guess).

Is it faster to send headers by webserver?

faster? Do you have any performance problems at that level? If not, forget that.

Does it have an effect on earlier processing the HTTP request?

HTTP headers are sent back to the client, so it happens at the response and not the request time.

Answered by greut

No related posts.

Leave a comment