Hi,
I was wondering how much slower things get if I use PHP on LPs.
What do you use PHP for if at all?
I know static HTML is way better for CDN's but is that the main reason people avoid PHP with mobile?
People don't use PHP on CDNs because they can't.
To process PHP you require a specific process running on the server (e.g. PHP-FPM), and CDNs simply don't have or offer this - thus PHP code is not even considered and just sits around in the files doing nothing as the raw code.
As for the impact on speed, this is negligible. You can run tests and show that all the PHP code on the page, GeoIP lookups and all that stuff happen in something like a millisecond - i.e. this is sure to have no noticeable impact on page load speed -- it's simply too fast in comparison to every other variable, e.g. DNS lookup times, connect times, page load speed, time to browser render, etc.
The real issue comes with volume where the PHP-related process may bottleneck by using a lot of server memory, but this can be avoided with good tuning and having server resources commensurate with the traffic you are sending.
I'm aware you can't use PHP on CDNs
By using static html the user never actually touches my server, but with PHP that becomes necessary. Is this a big deal in your experience? I don't understand why people use PHP at all if you can use javascript for all variable call outs, countdown scripts etc. Is there something I'm missing?
For things like GeoIP functionality and handset detection it's always going to be faster to do it locally i.e. through databases on your own server.
For example, MaxMind GeoIP - a local lookup might take 1 ms, whereas using their javascript service might add 200 ms and/or hold up page rendering, or show text flickering, etc. You could always make your own JS service or use JS and host it locally, but if you've moved things to your server it's just easier to use PHP since it's so easy to implement.
I guess my point is, once the web page is being loaded from your server for whatever reason, using PHP is going to add less time to your bottom line cf. using JS, all else being equal, and the code is not able to be ripped should that be a concern.
Ok thanks I'm probably never going to use php again because I can just pull the variables from my tracker.