On 2016-05-08 22:31, Nick Sabalausky wrote:

I've been moving the direction of hybrid approaches. Kinda like static
site generating, but the regenerating is done automatically as-needed,
can receive updates via HTTP GET/POST and do other real-time processing
during certain requests, etc. I don't know much about off-the-shelf
website tools out there (or whether there are any that work this way),
but it's what I did for the travis d compiler list (
https://semitwist.com/travis-d-compilers ):

It's fully dynamic templated, driven by Vibe.d and a database, new
entires are added automatically via HTTP POST, etc, it has REAL
server-side logic running. But instead of regenerating the HTML page on
every request (or dynamically regenerating a JSON/XML description of the
data on every request for client-side JS to then render - an approach I
never really understood), the Vibe.d-based site simply regenerates a
static HTML page when the *data* changes, which on most web pages is
much less frequent than actual page requests.

Something like sever side caching?

There are other ways to adjust static/dynamic balances too. There's
usually a LOT of components on even a fully-dynamic page that ARE
pre-cachable, even if the page as a whole isn't:

For example, a classic case where a static site generator wouldn't work:
An online shopping search results page. You can't predict ahead of time
what queries will be run and pregenerate entire results pages, but you
CAN pregenerate divs for how each individual item will be displayed when
it does appear in someone's results page. Then when someone runs a
search you just write the appropriate pre-built divs to the output
stream, one after the other.

Sounds like Russian doll caching [1].

In short: Hybrid site generating :) Only generate on-the-fly what NEEDS
to be on-the-fly. Only regenerate things when they change, not every
time they're viewed (unless they change more than they're viewed, like
maybe an admin-only site webstats page, but such cases are rare).

[1] http://blog.remarkablelabs.com/2012/12/russian-doll-caching-cache-digests-rails-4-countdown-to-2013

--
/Jacob Carlborg

Reply via email to