1

We set up a Netscaler in front of our PHP application server, the netscaler now preforms a large amount of HEAD requests as evidenced by our apache logs. I wonder if each time apache gets a one of these HEAD requests, it executes the PHP application, but then only returns the head information.

If so, I wouldn't see what is the server performance improvement.

tomwoods
  • 113
  • 3

1 Answers1

3

You can set headers in PHP. Thus a HEAD request would need to execute the PHP code to get all headers. The improvement would be that your server does not have to deliver the whole page. This is not about cpu time but about network usage. And of course, images, scripts, css, ... aren't loaded. Thus you have less network usage and less IO.

Jens
  • 362
  • 2
  • 4
  • 14
  • Thanks, that's what I supposed. But basically we are pushing the bandwidth issue from the application server to the Netscaler, because the Netscaler would serve the page in the stead of the application server, right? Would it make sense to have Netscaler cache only the images, scripts, css, etc? – tomwoods Sep 05 '12 at 17:46
  • Sorry, I don't know Netscaler. However, caching static content seems more appropriate than caching dynamic content. – Jens Sep 05 '12 at 17:50
  • Even if a Netscaler (or any caching device) were in play, it would need to be able to check the cached representation for validity, which is when a HEAD gets used. You could, I guess, alter your PHP to see if it was invoked with a HEAD, GET or POST etc. – Cameron Kerr Apr 24 '15 at 11:08