Summary

In this chapter, we covered the main aspects related to caching in Drupal 8, any module developer needs to be familiar with. We introduced some key concepts and talked about the two main types of caching--Internal Page Cache (used for anonymous users) and Dynamic Page Cache (used for any kind of user).

We dug deeper into cacheability metadata, which is probably the most important and common thing we need to understand. It's imperative to use this properly so that all the render arrays we build are cached and invalidated correctly. We've also seen how block plugins have specific methods we can use to define their cacheability metadata and how access results should also receive cacheability dependencies as needed. Stemming from this, ...

Get Drupal 8 Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.