I think the spirit of this article is correct, although some of the digs at modern web tech and SPAs seem to be beside the point. I used to have a "mildly dynamic website." It was a $5 digital ocean box. It ran nginx with php-fpm, mostly so it could have a Wordpress install in a subdirectory, and it had a unicorn setup for an experimental Rails app somewhere in there. Given that environment, the "mildly dynamic websi…
I am puzzled that your site required constant maintenance. I run a similar setup that I hardens using systemd service restrictions with nothing running as root. Then I subscribed to Debian and couple more mail lists with security announcements. It turned out I needed to spend like 20 minutes per month to maintain it. I also find that PHP works much better than Go regarding maintenance efforts. With Debian I have auto…
The demise of the mildly dynamic website (2022)
111–120 of 183 posts
Re: The demise of the mildly dynamic website (2022)
#112Re: The demise of the mildly dynamic website (2022)
#113Earlier quoted context omitted.
NearlyFreeSpeech.NET is good for this. Their main tier - "production" sites - are very inexpensive and the admins take care of OS and server-software updates. They have another tier - "non-production" sites - that are even cheaper and can be perfectly sufficient for a personal homepage. The admins maintain these servers as well but they might do beta testing on them. The environment is fully hackable and has PHP, SSH…
+1 for NearlyFreeSpeech! I’ve used them for years paying only 40-45 cents a month. I love that I can just ssh in and mess around. My site is mostly static but recently I wanted to add a private section for specific family and friends. So I implemented OAuth 2.0 login with 2 php files and an .htaccess rule.
Although I wonder how often your family actually uses it.
Re: The demise of the mildly dynamic website (2022)
#114On the other hand, if you have nothing, I don't think that the fastest/easiest way to a mildly dynamic website is to use PHP.
I got curious about the most minimalist setup I could get for running a static site that would also easily transition to becoming dynamic piece-by-piece. Here's what I came up with using NextJS:
1. Create a `package.json` containing:
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "14.2.4"
}
}
2. Create `app/layout.js` containing export default ({ children }) => children;
3. Create your home page at `app/page.js`. This is pretty much just what your index.html would have been before except it's wrapped with `export default () => (/.../)`: export default () => (
Home
Home
Welcome to our website!
);
4. Put the rest of your static files in `/public`Now, when you want to make one of your html files dynamic:
1. Move it from `public/your-page.html` to `app/your-page/page.js`
2. Wrap it with `export default () => (/.../)`
And there you go, you can start using JavaScript and JSX in your page.
Here's a summary of the differences between this approach and creating a PHP-based site:
1. You have to create 2 more files containing 13 more lines of code than you would with PHP
2. You need to find a NextJS web host rather than a PHP web host
3. Your dynamic pages are html-inside-javascript rather than php-inside-html. You are also technically writing JSX and not HTML, which has slightly different syntax.
4. You have a much easier to set up local dev server (Install `node`, then `npm install` and `npm dev`)
5. This framework can scale pretty seamlessly to "highly dynamic", whereas with PHP you'd probably need to introduce a frontend framework if you wanted to create something actually "highly dynamic".
6. You only need to learn one programming language (JavaScript) instead of two (JavaScript and PHP).
Re: The demise of the mildly dynamic website (2022)
#115This is missing any discussion of the dynamic functionality you can add with a bit of vanilla JavaScript.
Re: The demise of the mildly dynamic website (2022)
#116PHP made web development accessible with its simplicity, but ColdFusion was arguably more influential in the '90s. It led the way with features like built-in database connectivity and templating, setting the stage for how dynamic web pages would work as implemented by Microsoft and others, and even shaping what PHP itself became.
Separately, I think projects like Caddy carry on the spirit of the blog post.
Re: The demise of the mildly dynamic website (2022)
#117Earlier quoted context omitted.
Once you add API gateway, IAM roles/permissions, VPC, security groups, it gets a lot more complicated. Then you want to host a static web site, reverse proxying to API gateway, add CloudFront, WAF, etc. You'll go crazy setting this up manually, so you'll also want Terraform or CloudFormation to make it repeatable. For anything complex, you'll run into "slow start" issues and have to look at provisioned concurrency. L…
Yeah, it's an absolute explosion of complexity, and with it comes the risk that you miss something and are faced with a security issue or giant bill or both. What I would kill for is something in between all of this and FTPing PHP around like it's 1999. I've hunted for years for middle-ground solutions and haven't found anything. Security, cost, performance etc are important, sure, but what I really yearn for is a si…
Re: The demise of the mildly dynamic website (2022)
#118I think the spirit of this article is correct, although some of the digs at modern web tech and SPAs seem to be beside the point. I used to have a "mildly dynamic website." It was a $5 digital ocean box. It ran nginx with php-fpm, mostly so it could have a Wordpress install in a subdirectory, and it had a unicorn setup for an experimental Rails app somewhere in there. Given that environment, the "mildly dynamic websi…
> it requires endless system maintenance. Otherwise all the PHP stuff becomes vulnerable to random hacks How so? I've seen PHP websites & apps run for 10+ years in production without updates. Even longer with a simple "sudo apt update" every few months and a "composer update" every year or so. The maintenance rate is actually very very low.
Re: The demise of the mildly dynamic website (2022)
#119I think the spirit of this article is correct, although some of the digs at modern web tech and SPAs seem to be beside the point. I used to have a "mildly dynamic website." It was a $5 digital ocean box. It ran nginx with php-fpm, mostly so it could have a Wordpress install in a subdirectory, and it had a unicorn setup for an experimental Rails app somewhere in there. Given that environment, the "mildly dynamic websi…
it's really hard to overstate how great s3 sites are with cloudfront in front of them. mine costs me the added complexity for any level of dynamic-ness is really just not worth it, unless i'm going to go to the trouble of making a full-on app that needs a revenue model.
Re: The demise of the mildly dynamic website (2022)
#120Earlier quoted context omitted.
Once you add API gateway, IAM roles/permissions, VPC, security groups, it gets a lot more complicated. Then you want to host a static web site, reverse proxying to API gateway, add CloudFront, WAF, etc. You'll go crazy setting this up manually, so you'll also want Terraform or CloudFormation to make it repeatable. For anything complex, you'll run into "slow start" issues and have to look at provisioned concurrency. L…
Yeah, it's an absolute explosion of complexity, and with it comes the risk that you miss something and are faced with a security issue or giant bill or both. What I would kill for is something in between all of this and FTPing PHP around like it's 1999. I've hunted for years for middle-ground solutions and haven't found anything. Security, cost, performance etc are important, sure, but what I really yearn for is a si…