Are php includes the same as http requests?

Discussion in 'HTML / PHP / JavaScript / CSS' started by Allieso, Feb 20, 2011.

  1. Allieso

    Allieso Guest

    I have what I hope does not turn out as a stupid question. This is something trivial (perhaps) that I have been wondering about for a while.

    For instance:
    We use CSS image sprites to cut down on http requests turning what might be 8 image http requests into 1 which helps cut down on bandwidth, correct?

    When we organize php code, we like to make several folders for cleanness and keeping everything modular, etc.

    So, do all these php includes have the same bandwidth usage effect as an http request such as an image or css file?

    Are they cached like an image or css file? Since they are server side pre-page load I am assuming they are not cached?
     
  2. You're doing the right thing combining images and using CSS to reduce requests made from the browser to the server.

    The number of PHP files you have in the application will have absolutely no effect on the number of requests made / bandwidth used because PHP code is processed server side prior to the response being sent back to the client.
     

Share This Page