Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!8155
Commit patch
#155
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Commit patch
#155
issue/drupal-2352009:2352009-pp-3-bubbling-of
into
11.x
Overview
0
Commits
1
Pipelines
2
Changes
4
Open
Björn Brala
requested to merge
issue/drupal-2352009:2352009-pp-3-bubbling-of
into
11.x
10 months ago
Overview
0
Commits
1
Pipelines
2
Changes
4
Expand
Closes
#2352009
0
0
Merge request reports
Compare
11.x
version 1
f747d725
10 months ago
11.x (HEAD)
and
latest version
latest version
a469c976
1 commit,
3 weeks ago
version 1
f747d725
1 commit,
10 months ago
4 files
+
37
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
+
7
−
0
Options
@@ -16,6 +16,7 @@
use
Symfony\Component\HttpKernel\Event\ResponseEvent
;
use
Symfony\Component\HttpKernel\KernelEvents
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
use
Drupal\Core\Cache\CacheBackendInterface
;
/**
* Response subscriber to handle finished responses.
@@ -233,6 +234,12 @@ protected function setResponseCacheable(Response $response, Request $request) {
}
$max_age
=
$this
->
config
->
get
(
'cache.page.max_age'
);
// Respect max-age of the cacheable metadata, allowing for precise control
// over when cached pages should expire and be rebuilt.
$response_max_age
=
$response
->
getCacheableMetadata
()
->
getCacheMaxAge
();
if
(
$response_max_age
!==
CacheBackendInterface
::
CACHE_PERMANENT
&&
$max_age
>
$response_max_age
)
{
$max_age
=
$response_max_age
;
}
$response
->
headers
->
set
(
'Cache-Control'
,
'public, max-age='
.
$max_age
);
// In order to support HTTP cache-revalidation, ensure that there is a
Loading