Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AllowToolbarPath.php

class AllowToolbarPath

Cache policy for the toolbar page cache service.

This policy allows caching of requests directed to /toolbar/subtrees/{hash} even for authenticated users.

Hierarchy

  • class \Drupal\toolbar\PageCache\AllowToolbarPath implements \Drupal\Core\PageCache\RequestPolicyInterface

Expanded class hierarchy of AllowToolbarPath

1 string reference to 'AllowToolbarPath'
toolbar.services.yml in core/modules/toolbar/toolbar.services.yml
core/modules/toolbar/toolbar.services.yml
1 service uses AllowToolbarPath
toolbar.page_cache_request_policy.allow_toolbar_path in core/modules/toolbar/toolbar.services.yml
Drupal\toolbar\PageCache\AllowToolbarPath

File

core/modules/toolbar/src/PageCache/AllowToolbarPath.php, line 14

Namespace

Drupal\toolbar\PageCache
View source
class AllowToolbarPath implements RequestPolicyInterface {
    
    /**
     * {@inheritdoc}
     */
    public function check(Request $request) {
        // Note that this regular expression matches the end of pathinfo in order to
        // support multilingual sites using path prefixes.
        if (preg_match('#/toolbar/subtrees/[^/]+(/[^/]+)?$#', $request->getPathInfo())) {
            return static::ALLOW;
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
AllowToolbarPath::check public function Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface::check
RequestPolicyInterface::ALLOW constant Allow delivery of cached pages.
RequestPolicyInterface::DENY constant Deny delivery of cached pages.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal