core/modules/node/src/Controller/NodePreviewController.php | 1 + core/modules/node/src/NodeForm.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/modules/node/src/Controller/NodePreviewController.php b/core/modules/node/src/Controller/NodePreviewController.php index b1009be..e8ad426 100644 --- a/core/modules/node/src/Controller/NodePreviewController.php +++ b/core/modules/node/src/Controller/NodePreviewController.php @@ -26,6 +26,7 @@ public function view(EntityInterface $node_preview, $view_mode_id = 'full', $lan // Don't render cache previews. unset($build['#cache']); + $build['#cache']['max-age'] = 0; foreach ($node_preview->uriRelationships() as $rel) { // Set the node path as the canonical URL to prevent duplicate content. diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 36cfc74..d1713c5 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -76,6 +76,9 @@ public function form(array $form, FormStateInterface $form_state) { $uuid = $this->entity->uuid(); $store = $this->tempStoreFactory->get('node_preview'); + // Because of the temp store integration, this is not cacheable. + $form['#cache']['max-age'] = 0; + // If the user is creating a new node, the UUID is passed in the request. if ($request_uuid = \Drupal::request()->query->get('uuid')) { $uuid = $request_uuid;