diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index afa31e3..630314f 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -77,6 +77,9 @@ class Node extends ContentEntityBase implements NodeInterface {
   /**
    * Whether the node is being previewed or not.
    *
+   * The variable is set to public for it will result in a considerable
+   * performance improvement. See https://www.drupal.org/node/2498919
+   *
    * @var true|null
    */
   public $in_preview = NULL;
@@ -341,6 +344,21 @@ public function setRevisionAuthorId($uid) {
   /**
    * {@inheritdoc}
    */
+  public function isInPreview() {
+   return $this->in_preview;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setInPreview($in_preview) {
+    $this->in_preview = (bool) $in_preview;
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
     $fields['nid'] = BaseFieldDefinition::create('integer')
       ->setLabel(t('Node ID'))
diff --git a/core/modules/node/src/NodeInterface.php b/core/modules/node/src/NodeInterface.php
index 9610a99..1e81a92 100644
--- a/core/modules/node/src/NodeInterface.php
+++ b/core/modules/node/src/NodeInterface.php
@@ -168,4 +168,22 @@ public function setRevisionAuthorId($uid);
    */
   public function prepareLangcode();

+  /**
+   * Checks if the node is in preview mode.
+   *
+   * @return bool
+   *   TRUE if the node is in preview mode.
+   */
+  public function isInPreview();
+
+  /**
+   * Set if the node in to be viewed in preview mode.
+   *
+   * @param bool $in_preview
+   *   Boolean value to indicate if the node in to be viewed in preview mode.
+   *
+   * @return $this
+   */
+  public function setInPreview($in_preview);
+
 }
