4 ms·
I've been wondering why the approach that many imageboards had to dynamic content didn't catch on further. Essentially, on those boards, HTML wouldn't be rende
by xg15 5y ago
I've been wondering why the approach that many imageboards had to dynamic content didn't catch on further.
Essentially, on those boards, HTML wouldn't be rendered for each request but instead regenerated and stored on each update (POST request etc). The update script would generate a plain html file and store it in the www directory of a static web server, overwriting the previous version of that file. For GET requests, the server simply returned the current version of whatever file was requested.
This allowed the server to employ the full range of optimizations for static files (caching, partial content headers, etc) while still essentially serving dynamic content.
Of course, this kind of architecture makes only sense if updates are rare compared to GETs and if very little of the content depends on individual user identity. However e.g. for blogs or news sites, both conditions are usually given.
If there are small amounts of individualized content, this content could be pulled in via scripts.
- hlandau 5y agoGood point. Movable Type, one of the oldest blogging engines, used CGI Perl scripts for the admin interface and generated static files. I believe if someone made a comment it would cause the relevant pages to be regenerated in just this way. I've sometimes pondered generating "static" sites which comprise PHP files, where PHP is only used for the actually dynamic parts. So common headers/footers are regenerated only when changed, but things that change constantly are still dynamic. But this would probably be pointless optimization; if one is using PHP, one may as well use it.
- spiffytech 5y agoNetlify pushes this model for static sites. Their idea is to have your CMS or app backend trigger a rebuild every time content changes. That's slow if you have a lot of pages, so they have a way to lazy-rebuild pages when they're first accessed.