Issue Bug Closed

#99472URLs in hreflang tags and language menus are cached with the set of query parameters from the first request

Jigal van Hemert 01/05/23, 16:08 updated 11/06/26, 08:06

Description

If you flush the cache of a page with hreflang tags and a language menu the query parameters of the first request are cached and used for subsequent requests to that page, even if other query parameters are present in the URL.

In other issues (such as https://forge.typo3.org/issues/88264 ) it’s suggested to add those parameters to the cHash white list. This is not desirable in all cases.
If for example a solr result plugin is displayed on the page then the search query and the facet parameters should not be included in the cHash (that would flood the cache) but these parameters should be part of the hreflang tags and the language menu.
Currently the parameters used with the first request for that page after flushing the cache are used for the hreflang tags and the language menu of future requests to the page. If you select other facets or visit the page without any parameters then the cached parameters are also used.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Jigal van Hemert commented <span data-processor="relativetime" data-value="2023-01-10T11:58:39+00:00" > 01/10/23, 11:58 </span>

    Hi,

    As far as I can determine it addresses the problem only partly. The suggested extension keeps the parameters which are included in the routing configuration. Some query parameters that are not covered by the routing configuration can however be relevant for the hreflang tags and language menu.
    Query parameters for uncached plugins which are not transformed to url segments can be relevant for this.

    Another part of the issue is that hreflang tags and the language menu are normally part of the cached page. If query parameters for uncached plugins are relevant for these (I’m not completely sure if this is true for the canonical too) then they should not be cached. That can be arranged for the language menu, but unfortunately the hreflang tags are always part of the cached page.

  2. Benni Mack commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-11-06T08:06:30+00:00" > 11/06/26, 08:06 </span>

    Since TYPO3 v12.0 (#98488), addQueryString = 1, which the language menu and therefore the hreflang tags use by default, only adds the query arguments that were matched by routing. These are part of the cache identity, so parameters of the first request (e.g. search or facet parameters) are no longer cached into the hreflang tags and language menu. Showing parameters that are not part of the cHash in these links would need uncached hreflang tags, which is a separate feature request. Closing, feel free to open a new issue for that.