Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Are php includes the same as http requests?
Old 01-25-2011, 10:39 PM Are php includes the same as http requests?
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
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?
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
 
Register now for full access!
Old 01-25-2011, 10:55 PM Re: Are php includes the same as http requests?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Processing includes occurs entirely on the server. There are no additional http requests involved.

You can think of it as just telling PHP to find a certain file and copy its content into the currently executing script.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 01-25-2011, 10:58 PM Re: Are php includes the same as http requests?
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Wow thanks NullPointer!
I kind of thought that but was not sure. I have breaking a bunch of files for a recent wordpress theme and was starting to wonder if i was having too many.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 01-27-2011, 10:14 PM Re: Are php includes the same as http requests?
Novice Talker

Posts: 8
Trades: 0
As NullPointer "pointed" out, not really - unless you do something like this: include 'http://somedomain.com/testfile.php'; PHP can do that and in that case, it is making a request everytime the code is run. However, standard includes where you are just referencing a file system path make no http request.
jenny4pres is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Are php includes the same as http requests?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.72150 seconds with 12 queries