diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 55a3875..8f2345c 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1402,7 +1402,7 @@ function drupal_serve_page_from_cache(stdClass $cache) { // response to reply to a subsequent request for a given URL without // revalidation. If a Vary header has been set in hook_boot(), it is assumed // that the module knows how to cache the page. - if (!isset($hook_boot_headers['vary']) && !variable_get('omit_vary_cookie')) { + if (!isset($hook_boot_headers['vary']) && !config('system.performance')->get('cache.page.omit_vary_cookie')) { header('Vary: Cookie'); } diff --git a/core/modules/system/config/system.performance.yml b/core/modules/system/config/system.performance.yml index 7483921..7898f37 100644 --- a/core/modules/system/config/system.performance.yml +++ b/core/modules/system/config/system.performance.yml @@ -1,6 +1,7 @@ cache: page: enabled: '0' + omit_vary_cookie: '' max_age: '0' preprocess: css: '0' diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 5fb624a..109ab67 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2305,6 +2305,18 @@ function system_update_8039() { } /** + * Coverts omit_vary_cookie variable to config. + * + * @ingroup config_upgrade + */ +function system_update_8040() { + update_variables_to_config('system.performance', array( + 'omit_vary_cookie' => 'omit_vary_cookie', + )); +} + + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */ diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 20f4490..6cd1e8f 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -444,7 +444,7 @@ * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid * getting cached pages from the proxy. */ -# $conf['omit_vary_cookie'] = TRUE; +# $conf['system.performance']['cache.page.omit_vary_cookie'] = TRUE; /** * CSS/JS aggregated file gzip compression: