Skip to content

Commit 6006e77

Browse files
committed
minor #16156 Update http_cache.rst (helmis123)
This PR was merged into the 5.3 branch. Discussion ---------- Update http_cache.rst Update CacheKernel implementation in public/index.php Removal of "$request" which was moved to SymfonyRuntime <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- 2133ec4 Update http_cache.rst
2 parents 933f7a6 + 2133ec4 commit 6006e77

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

http_cache.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,14 @@ caching kernel:
9898
+ use App\CacheKernel;
9999
use App\Kernel;
100100
101-
// ...
102-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
101+
// ...
102+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
103103
+ // Wrap the default Kernel with the CacheKernel one in 'prod' environment
104104
+ if ('prod' === $kernel->getEnvironment()) {
105-
+ $kernel = new CacheKernel($kernel);
105+
+ return new CacheKernel($kernel);
106106
+ }
107+
return $kernel;
107108
108-
$request = Request::createFromGlobals();
109-
// ...
110109
111110
The caching kernel will immediately act as a reverse proxy: caching responses
112111
from your application and returning them to the client.

0 commit comments

Comments
 (0)