Implements \Drupal\Core\CacheDecorator\CacheDecoratorInterface::writeCache().
Cache an array of the system paths available on each page. We assume that aliases will be needed for the majority of these paths during subsequent requests, and load them in a single query during path alias lookup.
Overrides CacheDecoratorInterface::writeCache
public function writeCache() {
$path_lookups = $this
->getPathLookups();
// Check if the system paths for this page were loaded from cache in this
// request to avoid writing to cache on every request.
if ($this->cacheNeedsWriting && !empty($path_lookups) && !empty($this->cacheKey)) {
// Set the path cache to expire in 24 hours.
$expire = REQUEST_TIME + 60 * 60 * 24;
$this->cache
->set($this->cacheKey, $path_lookups, $expire);
}
}