Conversation
|
There was a problem hiding this comment.
Pull request overview
Moves reverse-proxy HTTP caching enablement out of public/index.php and into Symfony framework configuration, and adds config typing support for the staging environment.
Changes:
- Remove environment-based
CacheKernelwrapping from the front controller. - Enable/configure
framework.http_cacheviaframework.yamlwith prod/staging blocks. - Extend
config/reference.phppsalm array-shapes to includewhen@staging.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| public/index.php | Removes runtime cache-kernel wrapping and returns the base Kernel directly. |
| config/reference.php | Adds when@staging to psalm config and routes array-shapes. |
| config/packages/framework.yaml | Enables http_cache and adds when@prod/when@staging framework blocks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| return $kernel; | ||
| return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); |
There was a problem hiding this comment.
Removing the CacheKernel wrapping here means the app will no longer run behind Symfony's HttpCache reverse-proxy kernel in prod/staging. The framework.http_cache setting configures HttpCache options/services, but it doesn't instantiate App\CacheKernel by itself; you still need to wrap the kernel (or enable HttpCache via Symfony Runtime options) to actually get reverse-proxy caching.
| return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); | |
| $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); | |
| if ('prod' === $kernel->getEnvironment()) { | |
| return new CacheKernel($kernel); | |
| } | |
| return $kernel; |
| http_cache: true | ||
|
|
||
| when@test: | ||
| framework: | ||
| test: true | ||
| session: | ||
| storage_factory_id: session.storage.factory.mock_file | ||
|
|
||
| when@prod: | ||
| framework: | ||
| http_cache: true | ||
|
|
||
| when@staging: | ||
| framework: | ||
| http_cache: true |
There was a problem hiding this comment.
framework.http_cache: true is currently enabled globally (so it applies in dev/test too) and then duplicated again under when@prod/when@staging. If the intent is to enable reverse-proxy caching only for prod/staging (as the old index.php logic did), remove the global http_cache: true and keep it only in the relevant when@... blocks (or explicitly disable it in when@dev/when@test).
| http_cache: true | ||
|
|
There was a problem hiding this comment.
The comment above http_method_override says staging/prod also call enableHttpMethodParameterOverride() in index.php, but this PR removes that reverse-proxy creation. Please update/remove that comment so the configuration documentation matches the actual bootstrapping approach.



At the moment, our reverse proxy-style caching is hardcoded in the index.php. It think we're better off putting this in the Framework config.