Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ framework:
# Registers the constructor extractor.
with_constructor_extractor: ~

http_cache: true

Comment on lines +40 to +41
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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
Comment on lines +40 to +54
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
21 changes: 21 additions & 0 deletions config/reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,26 @@
* webpack_encore?: WebpackEncoreConfig,
* stimulus?: StimulusConfig,
* },
* "when@staging"?: array{
* imports?: ImportsConfig,
* parameters?: ParametersConfig,
* services?: ServicesConfig,
* framework?: FrameworkConfig,
* doctrine?: DoctrineConfig,
* doctrine_migrations?: DoctrineMigrationsConfig,
* security?: SecurityConfig,
* twig?: TwigConfig,
* twig_extra?: TwigExtraConfig,
* monolog?: MonologConfig,
* nelmio_cors?: NelmioCorsConfig,
* vich_uploader?: VichUploaderConfig,
* liip_imagine?: LiipImagineConfig,
* knp_paginator?: KnpPaginatorConfig,
* fos_elastica?: FosElasticaConfig,
* beelab_tag?: BeelabTagConfig,
* webpack_encore?: WebpackEncoreConfig,
* stimulus?: StimulusConfig,
* },
* "when@test"?: array{
* imports?: ImportsConfig,
* parameters?: ParametersConfig,
Expand Down Expand Up @@ -2118,6 +2138,7 @@ public static function config(array $config): array
* @psalm-type RoutesConfig = array{
* "when@dev"?: array<string, RouteConfig|ImportConfig|AliasConfig>,
* "when@prod"?: array<string, RouteConfig|ImportConfig|AliasConfig>,
* "when@staging"?: array<string, RouteConfig|ImportConfig|AliasConfig>,
* "when@test"?: array<string, RouteConfig|ImportConfig|AliasConfig>,
* ...<string, RouteConfig|ImportConfig|AliasConfig>
* }
Expand Down
12 changes: 2 additions & 10 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
}

return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
if ('prod' === $kernel->getEnvironment() ||
'staging' === $kernel->getEnvironment())
{
$kernel = new CacheKernel($kernel);
// https://symfony.com/doc/current/reference/configuration/framework.html#http-method-override
Request::enableHttpMethodParameterOverride();
}

return $kernel;
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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;

Copilot uses AI. Check for mistakes.
};