Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Fix psalm issue by adding missing parameter for profiler
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Jun 5, 2025
commit 0d78c6075948ce4a46adffcd97f742848e9e8a57
4 changes: 2 additions & 2 deletions lib/private/Route/CachingRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function serializeRouteCollection(RouteCollection $collection): array {
* @return array
*/
public function findMatchingRoute(string $url): array {
$this->eventLogger->start('cacheroute:match');
$this->eventLogger->start('cacheroute:match', 'Match route');
$key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . '#rootCollection';
$cachedRoutes = $this->cache->get($key);
if (!$cachedRoutes) {
Expand All @@ -83,7 +83,7 @@ public function findMatchingRoute(string $url): array {
$this->cache->set($key, $cachedRoutes, 3600);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key does not include any version number, so this probably means its always cached also on updates?
Because then there is no way to flush on update if the routes have changed, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the cache have a global prefix with all apps version numbers, see

$prefixClosure = function () use ($logQuery, $serverVersion): ?string {

}
$matcher = new CompiledUrlMatcher($cachedRoutes, $this->context);
$this->eventLogger->start('cacheroute:url:match');
$this->eventLogger->start('cacheroute:url:match', 'Symfony URL match call');
try {
$parameters = $matcher->match($url);
} catch (ResourceNotFoundException $e) {
Expand Down