Problem/Motivation
\Drupal\rest\Plugin\views\style\Serializer::render
calls off to the serialization system. Since Serialization API now allows explicit bubbling of cacheability metadata from normalizers
, it's possible for normalizers to indicate cacheable metadata.
By not collecting and bubbling this metadata, caching is not applied correctly for views configured with this style plugin.
Steps to reproduce
- Create a view that shows serialized entities.
- Add a normalizer with some custom cacheable metadata.
- See the metadata is never attached to the cache entries generated by rendering the view.
Proposed resolution
- Collect cacheable metadata.
- Apply that metadata to the views responses generated with the style plugin.