Skip to content

Conversation

mpdude
Copy link
Contributor

@mpdude mpdude commented Jul 4, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #57640
License MIT

The Router has a private static ?array $cache field that it uses to cache compiled route collections in the case that OpCache is not available to cache the file-based cache already. This is somewhat a poor man's Opcache replacement, useful e. g. for speedups during (functional) tests.

\Symfony\Component\Config\ResourceCheckerConfigCache::write contains special code to make sure the OpCache will reload files after they have been written, but the static property kind of "hides" this feature.

With this PR, the static cache entry is cleared as well.

@carsonbot carsonbot added this to the 5.4 milestone Jul 4, 2024
@carsonbot carsonbot changed the title [Router] Discard in-memory cache of routes when writing the file-based cache [Routing]  Discard in-memory cache of routes when writing the file-based cache Jul 4, 2024
@OskarStark OskarStark changed the title [Routing]  Discard in-memory cache of routes when writing the file-based cache [Routing] Discard in-memory cache of routes when writing the file-based cache Jul 4, 2024
@derrabus
Copy link
Member

derrabus commented Jul 4, 2024

Thank you @mpdude.

@derrabus derrabus merged commit cdd7595 into symfony:5.4 Jul 4, 2024
@mpdude mpdude deleted the clear-router-static-cache branch July 4, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants