RedirectCacheService
Ensure to clear the cache entry when a sys_redirect record is modified, also the main pool for getting all redirects.
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
Methods
- __construct() : mixed
- getRedirects() : array<string|int, mixed>
- Fetches all redirects available to the system, grouped by domain and regexp/nonregexp
- rebuildAll() : void
- Rebuild cache for each distinct redirect source_host.
- rebuildForHost() : array<string|int, mixed>
- Rebuilds the cache for all redirects, grouped by host as well as by regular expressions and respect_query_parameters.
Properties
$cache read-only
protected
FrontendInterface
$cache
Attributes
- #[Autowire]
- $service: 'cache.pages'
$connectionPool read-only
protected
ConnectionPool
$connectionPool
Methods
__construct()
public
__construct(FrontendInterface $cache, ConnectionPool $connectionPool) : mixed
Parameters
- $cache : FrontendInterface
- $connectionPool : ConnectionPool
getRedirects()
Fetches all redirects available to the system, grouped by domain and regexp/nonregexp
public
getRedirects(string $sourceHost) : array<string|int, mixed>
Parameters
- $sourceHost : string
Return values
array<string|int, mixed>rebuildAll()
Rebuild cache for each distinct redirect source_host.
public
rebuildAll() : void
rebuildForHost()
Rebuilds the cache for all redirects, grouped by host as well as by regular expressions and respect_query_parameters.
public
rebuildForHost(string $sourceHost) : array<string|int, mixed>
Does not include hidden or deleted redirects, but includes the ones with dynamic starttime/endtime.
Parameters
- $sourceHost : string