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
!10962
Resolve
#3436146
"Request subscriber"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Resolve
#3436146
"Request subscriber"
issue/drupal-3436146:3436146-request-subscriber
into
11.x
Overview
14
Commits
9
Pipelines
16
Changes
8
Closed
Sascha Grossenbacher
requested to merge
issue/drupal-3436146:3436146-request-subscriber
into
11.x
5 months ago
Overview
12
Commits
9
Pipelines
16
Changes
8
Expand
Closes
#3436146
0
0
Merge request reports
Compare
11.x
version 15
5b9300ff
4 months ago
version 14
9d5b5c1b
4 months ago
version 13
713c7dfe
4 months ago
version 12
b88628cd
4 months ago
version 11
2f63e481
4 months ago
version 10
ed1b796a
4 months ago
version 9
4f9886a8
4 months ago
version 8
04a9c93a
4 months ago
version 7
62926288
4 months ago
version 6
31215ed0
4 months ago
version 5
48f12d18
4 months ago
version 4
f43506bd
4 months ago
version 3
863d9129
4 months ago
version 2
6dc516c2
5 months ago
version 1
0c18c98c
5 months ago
11.x (base)
and
latest version
latest version
ba3b79c5
9 commits,
4 months ago
version 15
5b9300ff
8 commits,
4 months ago
version 14
9d5b5c1b
8 commits,
4 months ago
version 13
713c7dfe
7 commits,
4 months ago
version 12
b88628cd
6 commits,
4 months ago
version 11
2f63e481
4 commits,
4 months ago
version 10
ed1b796a
3 commits,
4 months ago
version 9
4f9886a8
4 commits,
4 months ago
version 8
04a9c93a
3 commits,
4 months ago
version 7
62926288
2 commits,
4 months ago
version 6
31215ed0
6 commits,
4 months ago
version 5
48f12d18
5 commits,
4 months ago
version 4
f43506bd
4 commits,
4 months ago
version 3
863d9129
3 commits,
4 months ago
version 2
6dc516c2
5 commits,
5 months ago
version 1
0c18c98c
4 commits,
5 months ago
8 files
+
126
−
38
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/Cache/EventSubscriber/CacheTagPreloadSubscriber.php
0 → 100644
+
52
−
0
Options
<?php
namespace
Drupal\Core\Cache\EventSubscriber
;
use
Drupal\Core\Cache\CacheTagsChecksumInterface
;
use
Drupal\Core\Cache\CacheTagsChecksumPreloadInterface
;
use
Drupal\Core\Site\Settings
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
use
Symfony\Component\HttpKernel\Event\RequestEvent
;
use
Symfony\Component\HttpKernel\KernelEvents
;
/**
* Preloads frequently used cache tags.
*/
class
CacheTagPreloadSubscriber
implements
EventSubscriberInterface
{
public
function
__construct
(
protected
CacheTagsChecksumInterface
$cacheTagsChecksum
)
{
}
/**
* Preloads frequently used cache tags.
*
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event.
*/
public
function
onRequest
(
RequestEvent
$event
):
void
{
if
(
$event
->
isMainRequest
()
&&
$this
->
cacheTagsChecksum
instanceof
CacheTagsChecksumPreloadInterface
)
{
$default_preload_cache_tags
=
array_merge
([
'route_match'
,
'access_policies'
,
'routes'
,
'router'
,
'entity_types'
,
'entity_field_info'
,
'entity_bundles'
,
'local_task'
,
'library_info'
,
'user_values'
,
],
Settings
::
get
(
'cache_preload_tags'
,
[]));
$this
->
cacheTagsChecksum
->
registerCacheTagsForPreload
(
$default_preload_cache_tags
);
}
}
/**
* {@inheritdoc}
*/
public
static
function
getSubscribedEvents
():
array
{
$events
[
KernelEvents
::
REQUEST
][]
=
[
'onRequest'
,
500
];
return
$events
;
}
}
Loading