@@ -1304,23 +1304,22 @@ the :class:`Symfony\\Component\\Serializer\\Serializer` class will call the
1304
1304
(or :method: `Symfony\\ Component\\ Serializer\\ Normalizer\\ DenormalizerInterface::supportsDenormalization `)
1305
1305
of all registered normalizers (or denormalizers) in a loop.
1306
1306
1307
- The result of these methods can vary depending of the value of the object to serialize, of the format to
1308
- use, and of the context. Consequently, **it is not cached ** by default.
1309
-
1310
- Because they are called recursively, these methods are usually a huge performance bottleneck. Moreover, most
1311
- normalizers (and denormalizers) always return the same result when the object's type, and the format are
1312
- the same.
1313
-
1314
- To hint the serializer that it's safe to cache the result of these methods (and then dramatically improve the
1315
- overall performance), such normalizers (and denormalizers) should implement the
1316
- :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ CacheableSupportsMethodInterface ` and return ``true `` when
1307
+ The result of these methods can vary depending on the object to serialize, the
1308
+ format and the context. That's why the result **is not cached ** by default and
1309
+ can result in a significant performance bottleneck.
1310
+
1311
+ However, most normalizers (and denormalizers) always return the same result when
1312
+ the object's type and the format are the same, so the result can be cached. To
1313
+ do so, make those normalizers (and denormalizers) implement the
1314
+ :class: `Symfony\\ Component\\ Serializer\\ Normalizer\\ CacheableSupportsMethodInterface `
1315
+ and return ``true `` when
1317
1316
:method: `Symfony\\ Component\\ Serializer\\ Normalizer\\ CacheableSupportsMethodInterface::hasCacheableSupportsMethod `
1318
1317
is called.
1319
1318
1320
- .. note ::
1321
-
1322
- Built -in :ref: `normalizers and denormalizers <component-serializer-normalizers >`, as well the ones
1323
- included in `API Platform `_ natively implement this interface.
1319
+ .. note ::
1320
+
1321
+ All built -in :ref: `normalizers and denormalizers <component-serializer-normalizers >`
1322
+ as well the ones included in `API Platform `_ natively implement this interface.
1324
1323
1325
1324
Learn more
1326
1325
----------
0 commit comments