News for hackers. Stuff that matters.
Re:This website has 81% battery power remaining by giancarlostoro on Sunday December 12, 2021 @01:14PM (#29532010)
I think so, WordPress that isnt cached to a frozen state on the backend is kind of silly in my eyes, the only exception would be comments, but you could hack around that by using Disqus or something, voila.
Re:This website has 81% battery power remaining by Cpoll on Sunday December 12, 2021 @01:40PM (#29532276)
> you could hack around that by using Disqus

But that's not actually solving the problem, it's just offloading it. Not to mention that you're selling your community to yet another tracking company, and jacking up user page load time.

Re:This website has 81% battery power remaining by mro_name on Sunday December 12, 2021 @01:50PM (#29532354)
>> by Disqus or something

depends on what you want, the low end is incoming comments as emails and putting them semi-manually into an iframe on the unchanged static article page. Doing it myself at https://blog.mro.name/2019/05/wp-to-hugo-making-of/ and sacrificed commenter speed.

Others may easily be more sophisticated than above brutalist solution. But still: comments in iframes align well with static sites IMO.

Edit: even better may be to phase in comments from HN or the fediverse or whatever you care about into an iframe. Be it copied or inline and re-styled.

Re:This website has 81% battery power remaining by charrondev on Sunday December 12, 2021 @05:55PM (#29534556)
I’m a technical lead for a SaaS community forum product and we handle billions of page views a month. Many of them don’t put any load on our servers though because guest pages are cached with a short duration and the cached page gets served up.

Today that’s cloudflare but in the past it was varnish.

Otherwise it is very dynamic. Different users have access to different content so we generally can’t cache full pages at the edge for authenticated users.

Re:This website has 81% battery power remaining by mro_name on Monday December 13, 2021 @02:21AM (#29537503)
nice. You're working regularly on the website. Not all do.
Re:This website has 81% battery power remaining by giancarlostoro on Sunday December 12, 2021 @05:30PM (#29534364)
I like this approach, is there something specific you're using to automate this at least in part? I feel like it could be made into a simple service with very limited JS to make it less "slow", unless you decide to manually approve of a comment.
Re:This website has 81% battery power remaining by mro_name on Monday December 13, 2021 @02:30AM (#29537562)
> automate

not yet, but I think of a delayed shell script (cron 15min?). JS (clientside) may be not of much use.

Or use a feedback webform via https://github.com/mro/form2xhtml - doesn't have to be email then.

Or monitor IMAP folders for accepted comments and cron them to the webserver a la https://codeberg.org/mro/flohmarkt.monte-ts.de/src/branch/ma... and online.sh

Re:This website has 81% battery power remaining by MayeulC on Sunday December 12, 2021 @02:35PM (#29532828)
I agree, but comments could also be static. Have a service handle comment submission, regenerate the page a bit later. If displaying to the user is an issue, do it client side. Most websites use a moderation queue anyway.

One could even generate a dedicated HTML page for the comments, and include it in an iframe, although inlining them is probably more performant.

Re:This website has 81% battery power remaining by beebeepka on Sunday December 12, 2021 @02:03PM (#29532494)
Forcing people to use disqus is a fantastic way to fuck over your userbase
Re:This website has 81% battery power remaining by yjftsjthsd-h on Sunday December 12, 2021 @01:51PM (#29532361)
Just POST to a PHP script that regenerates the cached HTML including comments.
Re:This website has 81% battery power remaining by johannes1234321 on Sunday December 12, 2021 @03:03PM (#29533069)
Even comments come quite rarely in most cases, so that the complete page with comments can be cached.
Re:This website has 81% battery power remaining by ComputerGuru on Monday December 13, 2021 @12:44AM (#29537029)
You don’t need disqus, you just invalidate the cache and regenerate it for only the next request, serving stale copies until the regen is complete. nginx or varnish can both do that out of the box.
Re:This website has 81% battery power remaining by IncRnd on Sunday December 12, 2021 @01:55PM (#29532397)
Comments are far from the only exception to static page caches! There are often dynamic changes via plugins or functions.php. There are shortcodes and a number of other examples too.
Re:This website has 81% battery power remaining by blondin on Sunday December 12, 2021 @09:03PM (#29535740)
we had semi-static comments you are talking about. they were called guestbooks. but we gave up on them.