Apr 04-05, 2025 Cáceres

Drupal Iberia Cáceres

Complejo Cultural San Francisco, Ronda de San Francisco, Cáceres‎, Spain

 

Submit your session / Envíe su sesión / Submete a tua sessão

 Until 28 February / Hasta el 28 de febrero / Até 28 de fevereiro 

 

Sponsor  / Patrocinar / Patrocinar 

More info on the link / Mas info en el enlace / Mais informações na ligação

Use lazy builders!!!!!!

Drupal’s Lazy Builder API is a game-changer for creating highly dynamic content without sacrificing performance. Instead of disabling caching for an entire render array or page, lazy builders let you keep things fast and efficient while injecting fresh, personalized content when needed.

Here’s the magic: the initial render array stays heavily cached, but lazy builders step in afterward to dynamically generate and insert new content. This makes it perfect for personalized experiences or optimizing slow-rendering code by giving it its own fine-grained caching bucket.

How does it work? Instead of rendering content directly, you drop in a lazy builder placeholder. Later, Drupal automatically calls a callback function to replace that placeholder with the actual content—seamlessly and efficiently.

If you’ve got the Big Pipe module enabled, things get even better! Your page can be streamed in parts, meaning slower functions won’t bottleneck the whole page. Big Pipe sends placeholders first, loads the footer separately, and then JavaScript dynamically swaps in the real content—ensuring a blazing-fast user experience.

What’s crazy is that so few people actually use lazy builders, even though they’re incredibly useful and performant! If you’re not taking advantage of them, you’re missing out on one of Drupal’s most powerful tools for optimizing dynamic content.

Audience
Intermediate
Session Category
Development & Performance