kreut Posted August 20, 2011 Share Posted August 20, 2011 Hello! I'm trying to understand exactly how http requests relate to a php script. 1) What would be considered a large amount? 2) How can I see how many I have for a given page? Thank you, Eric Quote Link to comment https://forums.phpfreaks.com/topic/245316-how-many-http-requests-for-a-php-script/ Share on other sites More sharing options...
cssfreakie Posted August 20, 2011 Share Posted August 20, 2011 Php is handled server side so http request are not and issue there. It outputs 1 chunk that is sent to the browser. If you want to find out how many http requests you make. Get an addon named YSlow for firefox or Chrome and run it. It will even tell you what you should do to optimize. as for performance have a read here: http://developer.yahoo.com/performance/rules.html Quote Link to comment https://forums.phpfreaks.com/topic/245316-how-many-http-requests-for-a-php-script/#findComment-1259962 Share on other sites More sharing options...
The Little Guy Posted August 21, 2011 Share Posted August 21, 2011 It outputs 1 chunk that is sent to the browser. It actually outputs one thing, but that can make multiple requests, such as: images, css, javascript, flash, audio, video, xml, etc. Steps (I believe, correct me if I am wrong or missed something): - Client goes to your website - Browser makes request to the dns server - The dns sever converts to ip - the ip is found and it is considered an http request - your web server (probably Apache) intercepts the request since it is listening on port 80 - Apache uploads data (when using: <input type="file">) it is then put into a tmp folder - When Apache loads the file requested, it checks for the file extension - If there is a if there is something associated with that extension, and the plugin is installed Apache sends the request to the program to do the work - The program (php in our case) takes the file and runs it through php doing what ever the php script tells it to do. - When the script is complete html is sent back to Apache, and Apache then sends it back out to the web to the requesting client Quote Link to comment https://forums.phpfreaks.com/topic/245316-how-many-http-requests-for-a-php-script/#findComment-1259999 Share on other sites More sharing options...
cssfreakie Posted August 21, 2011 Share Posted August 21, 2011 It outputs 1 chunk that is sent to the browser. It actually outputs one thing, but that can make multiple requests, such as: images, css, javascript, flash, audio, video, xml, etc. exactly....! 1 chunk (aka one thing)...... And to keep it on the subject PHP does not affect the amount of requests, it's that chunk it outputs that does. Quote Link to comment https://forums.phpfreaks.com/topic/245316-how-many-http-requests-for-a-php-script/#findComment-1260003 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.