Issue Bug Closed

#98126Page caching does not work as expected on multi language sites

Manfred Egger 08/12/22, 07:10 updated 12/06/22, 21:43

Description

I would expect that as soon as a page is cached it’s cached content is served to all clients. But if you have a multi language site and any client changes to a different language, the cached version isn’t served anymore.

Steps to reproduce:
  • Create a new TYPO3 installation and install the introduction package
  • Enable HTTP debug headers via config.debug = 1
  • Set config.cache_period = 86400
  • On the “home page” (HP) “Congratulations” create a new page translation
  • Open the HP – cache is created
  • Press F5 – cached page is served
  • change to page “Features” – cache is created
  • change to HP – cached page is served
  • switch to translated page – cache is created
  • Press F5 – cached page is served
  • switch back to HP in default language – cache is created instead of serving the cached page
  • switch to translated page – cache is created instead of serving the cached page

Here’s an example curl output (all caches were cleared before, a translation for german was created for the HP):

# Setting base domain without leading slash
$ DOMAIN="https://www.example.com"

# Do some calls to default language
$ curl -v "${BASE}/" 2>&1 | grep x-typo3-debug-cache
# empty result as page is not cached
$ curl -v "${BASE}/" 2>&1 | grep x-typo3-debug-cache
< x-typo3-debug-cache: Cached page generated 12-08-22 08:52. Expires 13-08-22 08:52

$ curl -v "${BASE}/features" 2>&1 | grep x-typo3-debug-cache
# empty result as page is not cached
$ curl -v "${BASE}/features" 2>&1 | grep x-typo3-debug-cache
< x-typo3-debug-cache: Cached page generated 12-08-22 08:56. Expires 13-08-22 08:56

$ curl -v "${BASE}/" 2>&1 | grep x-typo3-debug-cache        
< x-typo3-debug-cache: Cached page generated 12-08-22 08:55. Expires 13-08-22 08:55

# switch to language de
$ curl -v "${BASE}/de/" 2>&1 | grep x-typo3-debug-cache
# empty result as page is not cached
$ curl -v "${BASE}/de/" 2>&1 | grep x-typo3-debug-cache
< x-typo3-debug-cache: Cached page generated 12-08-22 08:58. Expires 13-08-22 08:58

# switch back to default language
$ curl -v "${BASE}/" 2>&1 | grep x-typo3-debug-cache
# empty result but why? Shouldn't the page be in the cache?

Do I get something wrong?

Reviews 1