Like in EZP-28956 where getContent() was added on Location, this is about adding getContentType on Content to avoid having to deal with loading logic and also further more to avoid repeated loads of content types in the system when we already have the Type (as we need it to build Content) and can thus pass it around on Content Items.
This implicit involves improving performance:
- No repeated content types loading when calling field functions in Twig, as they can now use the provided type info
- No implicit repeated loads for same language when having to build these content types over and over
- Add possibility to bulk load ContentTypes in SPI in order to handle this even more efficient when bulk loading content (either bulk load or on Location/Content Search results)
The issue where hidden in 5.x / 1.x due to inMemory cache feature in Stash, which we don't (yet) have re-introduced in 2.x. When we do re-introduce it it will be in a way that it is safe also for long running scripts and don't eat up all available memory until it crashes.