diff --git a/core/core.services.yml b/core/core.services.yml index 8d611a9..21a6b74 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -224,21 +224,21 @@ services: page_cache_kill_switch: class: Drupal\Core\PageCache\ResponsePolicy\KillSwitch tags: - { name: page_cache_response_policy } page_cache_no_cache_routes: class: Drupal\Core\PageCache\ResponsePolicy\DenyNoCacheRoutes arguments: ['@current_route_match'] public: false tags: - { name: page_cache_response_policy } - page_cache_no_cache_non_cacheable: + page_cache_deny_non_cacheable: class: Drupal\Core\PageCache\ResponsePolicy\DenyNonCacheableResponse public: false tags: - { name: page_cache_response_policy } page_cache_no_server_error: class: Drupal\Core\PageCache\ResponsePolicy\NoServerError public: false tags: - { name: page_cache_response_policy } config.manager: diff --git a/core/modules/page_cache/src/Tests/PageCacheTest.php b/core/modules/page_cache/src/Tests/PageCacheTest.php index 147f011..e00b947 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTest.php @@ -400,22 +400,25 @@ public function testFormImmutability() { \Drupal::state()->set('page_cache_bypass_form_immutability', TRUE); \Drupal::moduleHandler()->resetImplementations(); \Drupal::cache('render')->deleteAll(); $this->drupalGet('page_cache_form_test_immutability'); $this->assertText("Immutable: FALSE", "Form is not immutable,"); } /** - * Tests the difference between having a controller return a Response object - * versus returning a CacheableReponse + * Tests cacheability of a CacheableResponse + * + * Tests the difference between having a controller return a normal Response + * object versus returning a Response object that implements the + * CacheableResponseInterface. */ public function testCacheableResponseResponses() { $config = $this->config('system.performance'); $config->set('cache.page.max_age', 300); $config->save(); // Try to fill the cache. $this->drupalGet('/system-test/respond-reponse'); $this->assertFalse(in_array('X-Drupal-Cache', $this->drupalGetHeaders()), 'Drupal page cache header not found'); $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, post-check=0, pre-check=0, private', 'Cache-Control header was sent');