diff --git a/core/modules/search/src/Form/SearchBlockForm.php b/core/modules/search/src/Form/SearchBlockForm.php
index e154863022e10b0edb53d73b3974c1aa63556096..2345c80cad537fa5c99cf31b01feb1392ac8a1ad 100644
--- a/core/modules/search/src/Form/SearchBlockForm.php
+++ b/core/modules/search/src/Form/SearchBlockForm.php
@@ -7,8 +7,10 @@
 
 namespace Drupal\search\Form;
 
+use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Render\RendererInterface;
 use Drupal\search\SearchPageRepositoryInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -24,14 +26,34 @@ class SearchBlockForm extends FormBase {
    */
   protected $searchPageRepository;
 
+  /**
+   * The config factory.
+   *
+   * @var \Drupal\Core\Config\ConfigFactoryInterface
+   */
+  protected $configFactory;
+
+  /**
+   * The renderer.
+   *
+   * @var \Drupal\Core\Render\RendererInterface
+   */
+  protected $renderer;
+
   /**
    * Constructs a new SearchBlockForm.
    *
    * @param \Drupal\search\SearchPageRepositoryInterface $search_page_repository
    *   The search page repository.
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   The config factory.
+   * @param \Drupal\Core\Render\RendererInterface
+   *   The renderer.
    */
-  public function __construct(SearchPageRepositoryInterface $search_page_repository) {
+  public function __construct(SearchPageRepositoryInterface $search_page_repository, ConfigFactoryInterface $config_factory, RendererInterface $renderer) {
     $this->searchPageRepository = $search_page_repository;
+    $this->configFactory = $config_factory;
+    $this->renderer = $renderer;
   }
 
   /**
@@ -39,7 +61,9 @@ public function __construct(SearchPageRepositoryInterface $search_page_repositor
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('search.search_page_repository')
+      $container->get('search.search_page_repository'),
+      $container->get('config.factory'),
+      $container->get('renderer')
     );
   }
 
@@ -85,6 +109,9 @@ public function buildForm(array $form, FormStateInterface $form_state) {
       '#name' => '',
     );
 
+    // SearchPageRepository::getDefaultSearchPage() depends on search.settings.
+    $this->renderer->addCacheableDependency($form, $this->configFactory->get('search.settings'));
+
     return $form;
   }
 
diff --git a/core/modules/search/src/Plugin/Block/SearchBlock.php b/core/modules/search/src/Plugin/Block/SearchBlock.php
index 5bdfce34612e278e569ba6d3d3b9ee4a84cb9350..955929148bafa50dac17141b3f579b4d76d00f29 100644
--- a/core/modules/search/src/Plugin/Block/SearchBlock.php
+++ b/core/modules/search/src/Plugin/Block/SearchBlock.php
@@ -37,13 +37,4 @@ public function build() {
     return \Drupal::formBuilder()->getForm('Drupal\search\Form\SearchBlockForm');
   }
 
-  /**
-   * {@inheritdoc}
-   *
-   * @todo Make cacheable once https://www.drupal.org/node/2351015 lands.
-   */
-  public function getCacheMaxAge() {
-    return 0;
-  }
-
 }