Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Routing] Discard in-memory cache of routes when writing the file-based cache #57645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2024

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
10 of 12 checks passed
@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