@@ -17,6 +17,7 @@ Production Server Checklist
17
17
---------------------------
18
18
19
19
#. :ref: `Use the OPcache byte code cache <performance-use-opcache >`
20
+ #. :ref: `Use the OPcache class preloading <performance-use-preloading >`
20
21
#. :ref: `Configure OPcache for maximum performance <performance-configure-opcache >`
21
22
#. :ref: `Don't check PHP files timestamps <performance-dont-check-timestamps >`
22
23
#. :ref: `Configure the PHP realpath Cache <performance-configure-realpath-cache >`
@@ -42,6 +43,28 @@ every request. There are some `byte code caches`_ available, but as of PHP
42
43
5.5, PHP comes with `OPcache `_ built-in. For older versions, the most widely
43
44
used byte code cache is `APC `_.
44
45
46
+ .. _performance-use-preloading :
47
+
48
+ Use the OPcache class preloading
49
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50
+
51
+ .. versionadded :: 4.4
52
+
53
+ The feature that generates the preloading file was introduced in Symfony 4.4.
54
+
55
+ Starting from PHP 7.4, OPcache can compile and load classes at start-up and
56
+ make them available to all requests until the server is restarted, improving
57
+ performance significantly.
58
+
59
+ Symfony generates the file automatically with the list of classes to preload.
60
+ The file path is the same as the file generated for the service container but
61
+ with the ``preload `` suffix:
62
+
63
+ .. code-block :: ini
64
+
65
+ ; php.ini
66
+ opcache.preload =/path/to/project/var/cache/prod/App_KernelProdContainer.preload.php
67
+
45
68
.. _performance-configure-opcache :
46
69
47
70
Configure OPcache for Maximum Performance
0 commit comments