While working on making the breadcrumbs block cacheable, I noticed that they are also being rendered in
So I put a strategic "early return" statement in
template_preprocess_page(). In a place where the DB should not be touched at all:
/nodefrom 224 DB queries to 211. 13 DB queries saved!
/taxonomy/term/1from 207 DB queries to 185. 22 DB queries saved!
AFAICT in D7, breadcrumb building was tied to menu tree building so it didn't trigger additional DB hits. But in D8, it's a stand-alone concept. So there are DB queries for it, even when you don't use them!
Plus, there is a lot of cruft in there that should never ever be used, like
$variables['base_path'] = base_path();
(Typically used for hardcoding links, which breaks when a site is multilingual, and for referring to images, which breaks when the site is integrated with a CDN.)
|#1||template_preprocess_page_db-DEMONSTRATE-2232577-1-do-not-test.patch||498 bytes||Wim Leers|