axiom82 Posted September 16, 2009 Share Posted September 16, 2009 Are PHP files downloaded by the client during execution? One of the major issues I have with Object-oriented PHP is the framework becomes sizable fast. You include 10 classes just for one small page to have all of the base functionalities required to make the page run...and after all of these includes you have spent a massive amount of unnecessary bandwidth...or so it seems? This returns me back to the original question? Does the client actually download the php class files or does the server just execute them and push the html out for download? If there is no downloading of the php framework, then I can see how Object-oriented programming is a much better idea...that is, if it does not overload bandwidth and other factors of website performance. Please respond. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/174394-php-files-client-download-or-server-executed/ Share on other sites More sharing options...
Philip Posted September 16, 2009 Share Posted September 16, 2009 The client will never download any PHP code unless you specifically force it using headers (or your server isn't config'd right.) Everything is parsed on the server side, and then that is what the client downloads. Quote Link to comment https://forums.phpfreaks.com/topic/174394-php-files-client-download-or-server-executed/#findComment-919236 Share on other sites More sharing options...
axiom82 Posted September 16, 2009 Author Share Posted September 16, 2009 The client will never download any PHP code unless you specifically force it using headers (or your server isn't config'd right.) Everything is parsed on the server side, and then that is what the client downloads. So then what you are saying is that I could have a 2 megabyte custom php framework built for xyz.com and as a result the client and server would not have to download this extra information which makes the framework so easy to manage from class files? Quote Link to comment https://forums.phpfreaks.com/topic/174394-php-files-client-download-or-server-executed/#findComment-919241 Share on other sites More sharing options...
Philip Posted September 16, 2009 Share Posted September 16, 2009 If your server can parse it just as fast, yes. Quote Link to comment https://forums.phpfreaks.com/topic/174394-php-files-client-download-or-server-executed/#findComment-919243 Share on other sites More sharing options...
axiom82 Posted September 16, 2009 Author Share Posted September 16, 2009 If your server can parse it just as fast, yes. I've been programming for years. Wow, I feel like a tool right now LOL. So really it's just a processing thing. Quote Link to comment https://forums.phpfreaks.com/topic/174394-php-files-client-download-or-server-executed/#findComment-919244 Share on other sites More sharing options...
corbin Posted September 16, 2009 Share Posted September 16, 2009 Yes... Objects are of course slower than procedural coding, but the slowdown is usually negligible, and in my opinion, with large projects, OOP is much easier in the long run. Quote Link to comment https://forums.phpfreaks.com/topic/174394-php-files-client-download-or-server-executed/#findComment-919259 Share on other sites More sharing options...
Philip Posted September 16, 2009 Share Posted September 16, 2009 Yes... Objects are of course slower than procedural coding, but the slowdown is usually negligible, and in my opinion, with large projects, OOP is much easier in the long run. Quote Link to comment https://forums.phpfreaks.com/topic/174394-php-files-client-download-or-server-executed/#findComment-919262 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.