Project

General

Profile

Actions

Bug #78068

closed

Page get cached when called without cHash-param

Added by Peter Rauber over 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2016-09-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

Steps to reproduce:
  • install an extensions (like news)
  • create 2 news entries
  • place the news-plugin (and set the storage of the news-entries)
  • call the page of a news-entry (without cHash-param) i.e. index.php?id=1&tx_news_pi1%5Bnews%5D=1&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail
  • call the page again without cHash, but for another news-id: index.php?id=1&tx_news_pi1%5Bnews%5D=2&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail

Expected Result:
On the 1st call, you see the 1st news-entry, on the second call, you see the 2nd news-entry

Actual Result:
You see on both calls the 1st news-entry (because it gets cached in the 1st call)

So: Why does TYPO3 cache the page when there are different get-parameters sent? I understand the cHash-system, but there are situations when the cHash is NOT present and I want my system to render a proper page even in those cases.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #88688: routeEnhancer: cHash validation errors are cached and subseqently show up on correct URLs, too (and vice versa)New2019-07-04

Actions
Actions #1

Updated by Dmitry Dulepov over 7 years ago

You should read the article named "Misteries of cHash". Google for it. In your case cHash is required if you want to see proper records. No other way.

Actions #2

Updated by Peter Rauber over 7 years ago

Thank you for replying to this. I think right now we are in a very bad situation (at least in our agency we have lots of trouble because of this). I did not mention about the connection to realUrl yet because I think the problem is clearly on TYPO3-core-side right now. But it has to do with the current realUrl-version, especially when an editor previews his own new news-article and is logged into the backend the same time. We cannot prevent them from being logged in and so we run into the problems because TYPO3 caches the page then.
Also we need to clear the urlcache sometimes especially after subtree-movements so we cannot rely on the urlcache to have the cHash stored and I think a "cache" is not the place for persistent data. So I think this is a core-bug that there is not at least an option to prevent a page from being cached when there are any GET-params (except of those in [FE][cHashExcludedParameters]) and NO cHash.

Right now there is only 1 solution: I put all parameters that I can think of into [FE][cHashRequiredParameters] and set [FE][pageNotFoundOnCHashError] = 0. But this has 2 big disadvantages:
  • I need to maintain a list of get-parameters of all my plugins and still think of this when I install another extension one day
  • incorrect cHashes also dont trigger an 404-error anymore

If only I could put "*" into [FE][cHashRequiredParameters] I would be (half) happy already.

Any other solution is welcome how to get around this problem.

Actions #3

Updated by Dmitry Dulepov over 7 years ago

This is NOT a bug of the core but of your implementation :) You are REQUIRED to generate links with cHash if your plugins use parameters and they are cached. It is fully your responsibility. TYPO3 may not guess what you want to do in your plugin or your TypoScript. It just does what you asked it to do. If you forgot a useCacheHash for typolink, you will get the behavior you describe. In such case the behavior is as expected!

You should check your code and your TypoScript and find what makes links without cHash.

As to realurl, switch to 2.1.4. This should solve at least half of cases with missing cHash.

Actions #4

Updated by Peter Rauber over 7 years ago

This is NOT a bug of the core but of your implementation :) You are REQUIRED to generate links with cHash if your plugins use parameters and they are cached. It is fully your responsibility. TYPO3 may not guess what you want to do in your plugin or your TypoScript. It just does what you asked it to do. If you forgot a useCacheHash for typolink, you will get the behavior you describe. In such case the behavior is as expected!

I know how to create the links with the chash-parameter, that is not the problem here. The problem is the behaviour when the cHash is missing. Just caching the page and deliver it from cache on the next is just not right.

You should check your code and your TypoScript and find what makes links without cHash.

Everybody can strip that parameter off from the url, so I dont have control about that. I like my system to react properly in those cases. But that is hard to do if there is no option and TYPO3 just caches.

As to realurl, switch to 2.1.4. This should solve at least half of cases with missing cHash.

Thanks for that, this is a good information. Will have read the code in the commits or is there somewhere a changelog?

Actions #5

Updated by Susanne Moog over 4 years ago

  • Sprint Focus set to On Location Sprint
Actions #6

Updated by Benni Mack over 4 years ago

  • Status changed from New to Closed

I think this issue is solved with TYPO3 v9+, as we've reword the cHash calculation, and RealURL 2.1.4 fixed the issue. If you feel otherwise, let me know and I'll reopen the ticket.

Actions #7

Updated by Oliver Hader over 4 years ago

  • Related to Bug #88688: routeEnhancer: cHash validation errors are cached and subseqently show up on correct URLs, too (and vice versa) added
Actions

Also available in: Atom PDF