3 ms·
Generally the approach is fragment caching... so you're caching some block of HTML that would otherwise hit the DB (Think something like a block of configurable
by TylerE 5y ago
Generally the approach is fragment caching... so you're caching some block of HTML that would otherwise hit the DB (Think something like a block of configurable sidebar links, or a "latest posts" block.
HTML, not assets.
Some such setups (like one I wrote for a busy Drupal newspaper site way back when) can support clearing relevant cache entries on DB write, so you're essentially never serving stale data, but can save _substantial_ DB load - and possibly webserver load too, depending on how computationally intensive the HTML generation is.
- jayd16 5y agoI guess this is easier than read replicas? I can't imagine there's too much work to be saved by skipping the component building.
- TylerE 5y agoYes, if the queries involve lots of fiddly calculation (for instance, the newspaper system did a lot of fancy stuff around calculating good line breaks and wrapping, or the queries themselves are complicated, involve subqueries, many joins, etc.
- zepolen 5y agoDB lookup + rendering vs cache lookup + concatenating. Yes it adds up.