8 ms·
Many years ago I had a job to add some features to an existing PHP site. The code base was a mess. I think there were 7 copies of the code in production that we
by cletus 5y ago
Many years ago I had a job to add some features to an existing PHP site. The code base was a mess. I think there were 7 copies of the code in production that were copied and modified slightly to some specific purpose. It was like 300,000 lines of code (IIRC, it's been awhile).
This forced me to do what I always try and avoid doing (because no one will thank you for it) and that is to clean it up. Some of it was necessary (eg it was open to SQL injection). In doing so I reduced it down to <20,000 including the new features required.
This was a fairly stock standard database driven website but in just doing things the right way the page load times got to under 50ms (from 500-1000ms). This wasn't an SPA (of course) but I remember thinking how refreshing it was. You could link to any page. Those links loaded superfast (this is the bane of SPAs when they support deep-linking at all) and ran on everything just fine.
This is actually one of the best featurs about PHP too: a static functional core so there's basically no bootstrapping. This means you can tear down all the resources of rendering a page. Performance becomes way more predictable and you're way less prone to resource leaks.
There is magic in fast loading pages and I miss that about good Web 1.0 sites.
This is actually the biggest problem with all the ad and tracking JS packages: the load times go to shit. This becomes a justification for SPAs
As for Web 3.0... ugh. Why? Just... why? I guess that's a whole separate topic.
- ryanbrunner 5y agoThis is still 100% possible, and many frameworks support it. SPAs are not the only way to build things, and frankly aren't even the most popular way to build things outside of tech startups.
- rambambram 5y agoWhat you describe matches exactly my view on webdevelopment. Every click is a new request (with some exceptions, which prove the rule). Instead of jumping from document to document by clicking a link, it becomes one big flow with fast page loads. If you have fast page loads (easily done with PHP), it feels and behaves like any other application.