Bug #87683

TitleTagProvider always get the cached entry

Added by Guido Schmechel 7 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Should have
Category:
SEO
Target version:
-
Start date:
2019-02-10
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Given scenario:
I have a searchresult page (e.g. UID 42). The post requests variables are used for generating title tag and meta description. There is a custom TitleTagProvider which deliver a custom title, e.g. "Hello world 123" or if another search is correct "Hello world 456"

Btw: The searchresultAction is uncached.

Output:
Case 1: "Hello world 123"
Case 2: "Hello world 123"

Expected Result:
Case 1: "Hello world 123"
Case 2: "Hello world 456"

Problem:
TYPO3 saves title Tag, also custom Provider, in typo3/sysext/core/Classes/PageTitle/PageTitleProviderManager.php $cacheIdentifier. It never looks for the content of the titleTag.

$cacheIdentifier =  $this->getTypoScriptFrontendController()->newHash . '-titleTag-' . $provider;

Possible solution:
Integrate (hashed?) titleTag content in the cacheIdentifier.

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/PageTitle/PageTitleProviderManager.php#L69

Same problem exists for the MetaTags.


Related issues

Related to TYPO3 Core - Bug #88179: Meta tags and page title are unnecessarily cached in separate cache entries Resolved 2019-04-19

History

#1 Updated by Richard Haeser 7 months ago

  • Category set to SEO
  • Assignee set to Richard Haeser

#2 Updated by Gerrit Code Review 7 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59684

#3 Updated by Gerrit Code Review 7 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59684

#4 Updated by Richard Haeser 7 months ago

  • Status changed from Under Review to Needs Feedback

Is the title "Hello world 456" set by an uncached element?

#5 Updated by Guido Schmechel 7 months ago

I have an uncached searchAction. It fetches two values from the database and then does that here:

            $title = $postal->getPostal() . ' ' . $postal->getCity();
            $titleProvider = GeneralUtility::makeInstance(PoiTitleProvider::class);
            $titleProvider->setTitle($title);

PoiTitleProvider is just a simple class with a title setter.

Registration

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(trim('
    config.pageTitleProviders {
        own {
            provider = Ayacoo\AyacooPoi\PageTitle\PoiTitleProvider
            before = record
            after = altPageTitle
        }
    }
'));

#6 Updated by Richard Haeser 5 months ago

  • Status changed from Needs Feedback to New

#7 Updated by Guido Schmechel 5 months ago

  • Related to Bug #88179: Meta tags and page title are unnecessarily cached in separate cache entries added

#8 Updated by Richard Haeser 3 months ago

  • Status changed from New to Resolved

This is fixed with the release of v9.5.8

Also available in: Atom PDF