Overview
Blocks in Drupal 8 actually consist of two separate API structures to create a user interface similar to previous iterations of Drupal. These two APIs are the Block Plugin API, which is a reusable standalone API, and the Block Entity API, which is a Drupal 8-specific implementation for placing blocks and controlling their visibility.
The Cache API has been significantly improved in Drupal 8. The following sections explore each feature in more detail.
For a quick overview, see the Cache API documentation page.
Cacheability Metadata
Everything that is rendered directly or used to determine what to render provides cacheability metadata — from access results to entities and URLs.
Cacheability metadata consists of three properties:
Cache contexts = (request) contextual dependencies
Cache contexts are similar to the HTTP
Varyheader.
Why?
Cache contexts provide a way to create context-dependent variants of something that needs to be cached. It makes caching logic easier to read and avoids repeating the same conditional logic wherever context-based variation is needed.
Examples:
Cache max-age = time-based dependencies
Cache max-age is similar to the HTTP max-age directive in the Cache-Control header.
Why?
Cache max-age provides a declarative way to create time-based cache dependencies.
Varnish Cache is a web application accelerator, also known as a caching HTTP reverse proxy. Varnish is used on thousands of Drupal sites to increase page load performance by 10-1000x, and it can be used with cache tags to simplify cache invalidation.
For basic cache tag integration, you need to do three things to ensure Varnish works well with the cache tags generated by Drupal:
The CacheableDependencyInterface in Drupal 8 simplifies working with cache tags, cache contexts, and max-age.
This interface operates at the intersection of the Cache API and Response. Since it is primarily a response, this is where the core information resides.
See also
Route access checkers, hook_entity_access(), and anything that is expected to return an AccessResultInterface object must add appropriate cacheability metadata.
If you haven’t yet, read about cache tags, cache contexts, and max-age.
The CKEditor API is new in Drupal 8.
Note that this only applies to the CKEditor module API in Drupal 8, not the CKEditor JavaScript library API – for that, see http://docs.ckeditor.com/.
For more detailed information about what this module does, see the Text Editor module documentation.
API Features
Organized by least commonly used APIs:
CKEditor Skins