Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Either way, it's the web server that sends the headers. –  John Gardeniers Mar 31 '12 at 12:47
    
I meant that webserver will send the header defined its in own config before processing the PHP via fastcgi where PHP generates headers. –  All Mar 31 '12 at 12:54
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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