news icon indicating copy to clipboard operation
news copied to clipboard

Page 1 of list view shows cached content of another page under certain circumstances

Open h-e-l-l-o-w-o-r-l-d opened this issue 3 years ago • 5 comments

Bug Report

Introduction This is a longstanding and annoying bug on our website and I am finally able to provide reproduce steps.

Current Behavior

  1. Clear cache of page with the listview plugin (either by deleting the page cache or saving a random news record)
  2. Call URL /pagewithlistview?tx_news_pi1%5B%40widget_0%5D%5BcurrentPage%5D=2
  3. Go back to /pagewithlistview by clicking pagination page 1 or by directly entering the url

Result: The URL stays but the content of page 2 is shown. The pagination also highlights page 2. Problem: There's no way to reach page 1 with the latest news. All other pagination pages work as expected, just not page 1.

Expected behavior/output Calling /pagewithlistview should output the latest news

Environment

  • TYPO3 version: 10.4.17
  • news version: 8.5.2
  • Is your TYPO3 installation set up with Composer (Composer Mode): yes
  • OS: Windows 10

Possible Solution Clearing the cache of the page with the listview plugin helps. But it comes back sooner or later.

Hint: If you add a cHash to the URL in the reproduce steps, then it works! So...

/pagewithlistview?tx_news_pi1%5B%40widget_0%5D%5BcurrentPage%5D=2&cHash=aadfddf69917393840aff4dce0157800 instead of /pagewithlistview?tx_news_pi1%5B%40widget_0%5D%5BcurrentPage%5D=2

Unfortunately the URL without the cHash is requested by a bot and who knows who else might call such an URL. So blocking specific bots is not a solution for me.

Summary: In our live environment the problem occurs when someone of our editors creates or updates a news-record (page cache gets deleted) and right after that the URL from step 2 is called.

Workaround for now Set page cache to 5 minutes -> actually not wanted.

Additional context I tried with/without routeEnhancer and with/without settings.disableOverrideDemand to make sure it's not the cause for the problem -> same behaviour.

What can i do?

Cheers

h-e-l-l-o-w-o-r-l-d avatar Jul 20 '21 12:07 h-e-l-l-o-w-o-r-l-d

Same problem here. If I remember correctly it doesn't have to do with current extension nor CMS versions, as I also had this behaviour in the past. At least with CMS 9, but iirc 8 also.

arnekolja avatar Aug 04 '21 11:08 arnekolja

I can confirm the problem, but for me it is not always 100% reproducible.

scheibome avatar Sep 20 '21 07:09 scheibome

The same problem happens with the ext:blog extension. I just had a case where going to the main blog page path/to/blog shows the posts from page 3.

The pagination links looks like this: https://www.domain.tld/path/to/blog?pk_campaign=rnl_01_2020&pk_kwd=letzter_Blogeintrag https://www.domain.tld/path/to/blog/page-2?pk_campaign=rnl_01_2020&pk_kwd=letzter_Blogeintrag

The addition of ?pk_campaign=rnl_01_2020&pk_kwd=letzter_Blogeintrag was only used in newsletter mailings to track the pageview with Matomo.

medarob avatar Sep 21 '21 07:09 medarob

The problem still exists. The pagination still seems to be cached for opening the pages (URLs) without parameters, too.

WasteWalking avatar Nov 20 '21 12:11 WasteWalking

Enforcing the cHash for either the whole system or a specific parameter helps to avoid this behaviour. So either configure the pagination to be fully readable via site configuration routes (which always includes the cHash internally) or configure the cacheHash behaviour according to:

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Configuration/Typo3ConfVars/FE.html#cachehash

Bunnyfield avatar Jul 20 '23 13:07 Bunnyfield