Add a cache for typoLink()
|Priority:||Should have||Due date:|
Sometimes a page has many same links, for example list view for a product could has links from a preview image, from a title and a teaser description, all links going to detailed view of a product and all links has the same typoscript config.
In such cases typoLink() function can benefit from inner cache – if typolink config has same md5 from serialized config, then url and tag params is not being calculated again (it is rather big function) but retrieved from cache.
Content being placed inside A tag of course not cached, only tag.
Such cache is essential when TS-templates are heavy used - if php code in plugin is involved only in data preparing and all rendering being done in template then we have to call typolink many times with same config or to use ugly workaround "caching" with help of LOAD_REGISTER
(issue imported from #M17401)
Updated by Fedir RYKHTIK over 2 years ago
It's a reasonable proposition.
We could cache the "href" value, link without tag. The type of the cache could be global : for all pages, or only for current instance of the page. If the cache is global, it's possible to store the typolink in the database, or in typo3temp directory, which is more interesting from the point of view of workload.
The more optimal way - is to create the systeme of caching for different subobject, and to implement not only with TypoLink, but with all the objects and subobjects, generated by TypoScript. Eachtime object is found on the page, it's attributes are sorted, imploded and hashed in sha256sum. If there are no such object in registry, the object would be stored into the filesystem cache.
Such caching could be implemented even for *_INT objects, because the instances could repeat each other.
Updated by Dmitry Dulepov 10 months ago
- Target version deleted (
This will not work if you have to create links across domains or links to restricted pages.