O'Reilly logo

Drupal 8 Module Development by Daniel Sipos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Placeholders and lazy building

Now that we've seen a bit how the cacheability metadata can be used in the more common scenarios, let's shift gears and talk about those page components, which have highly dynamic data.

When we set the maximum age of our Hello World salutation to zero seconds (don’t cache), I mentioned that there are ways this can be improved in order to help performance. This takes the form of postponing the rendering of the respective bit to the very last moment with the help of placeholders. But first, a bit of background.

Each of the cache properties we talked about can have values that make caching the render array pointless. We've already talked about the maximum age being set to zero, but you can also argue very low expiration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required