Feature #24888

Add a cache for typoLink()

Added by Vladimir Podkovanov over 2 years ago. Updated 17 days ago.

Status:Closed Start date:2011-01-29
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
TYPO3 Version:4.4 Complexity:
PHP Version:
Votes: 0

Description

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)


Related issues

related to Core - Bug #24389: speed up typoLink function by caching domain records Resolved 2010-12-22
duplicates Core - Bug #17421: tslib_cObj::typoLink() is slow / patch to add caching Closed 2007-06-27

History

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 (0)

This will not work if you have to create links across domains or links to restricted pages.

Updated by Alexander Opitz 17 days ago

  • Status changed from New to Closed

Closing as duplicate of #24888

Also available in: Atom PDF