4 ms·
You're looking for "server side includes." Most HTTP web servers provide such a feature, as do many CDNs. Here's the Nginx module's documentation: https://ngin
by mdavidn 2y ago
You're looking for "server side includes." Most HTTP web servers provide such a feature, as do many CDNs. Here's the Nginx module's documentation:
https://nginx.org/en/docs/http/ngx_http_ssi_module.html https://nginx.org/en/docs/http/ngx_http_ssi_module.html
- andai 2y agoI used this all the time with PHP back in the day. include("header.html");
- d13 2y agoExactly. This is how it was always done and it works great.
- frugalmail 2y agoSo you're replacing the "complexity" of the static site generator with the "complexity" of custom web server configuration. I think the post you're replying to was trying to make the point "it's worth the complexity"
- nox101 2y agoThe only difference between a service side include and a static site generator include is whether the include happens build time or serve time (and cached). Any issues with including will be exactly the same regardless of where this happens.
- curtisblaine 2y agoIf you're running your server, though, it's another level of complexity and support compared to uploading your pages to some static CDN or bucket (yes I know a CDN is a server, but it's 1. a solved problem 2. not maintained by you).
- freedomben 2y agoI do a ton of devops/infrastructure so I hate to use myself as any sort of benchmark, but is it really that hard to run your own VPS with Nginx? Especially nowadays, there are tons of pre-canned examples you can tweak and AI can write most any nginx.conf you need as well. If you're just serving static content, you can scale to massive heights with Nginx on a small VPS with Cloudflare in front.
- throwitaway1123 2y agoIt's not hard but why even bother with it at all just to serve static files? If I have Cloudflare in front of the VPS, then I might as well just use Cloudflare Pages where I can git push to deploy, and avoid paying for and administering a VPS.