Bug #78068
closedPage get cached when called without cHash-param
0%
Description
- 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.
Updated by Dmitry Dulepov about 8 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.
Updated by Peter Rauber about 8 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.
- 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.
Updated by Dmitry Dulepov about 8 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.
Updated by Peter Rauber about 8 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
fortypolink
, 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?
Updated by Susanne Moog almost 5 years ago
- Sprint Focus set to On Location Sprint
Updated by Benni Mack almost 5 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.
Updated by Oliver Hader almost 5 years ago
- Related to Bug #88688: routeEnhancer: cHash validation errors are cached and subseqently show up on correct URLs, too (and vice versa) added