doufu9836 2017-09-25 14:12
浏览 43
已采纳

错误的TYPO3页面缓存

This Problem occurs sporadically on Pages with a large Number of visitors. Sometimes TYPO3 displays the content of a completely different page (including the HTML head Section).

For example, if the user calls the following page: /products/ (default Controller ProductController with listAction) TYPO3 shows the content of a random Controller and action of the same Plugin on the Page (like ApplicationController with showAction). The Site does not redirect to another Page, it's just showing wrong content!

I already tried the following things:

  • I added the Controller + action to the nonCacheableControllerActions (Problem occurs a day later again)
  • Adding ?no_cache=1 to the URL (Problem is solved, but the page speed is reduced)
  • Clearing Cache (Problem is solved, no matter what cache is cleared. But the Problem occurs a day later again)
  • I wrote a script which called the page every few minutes which seems to fix the problem.

Does anybody else have the same Problem?

Specifications:

  • TYPO3 Version: 7.6.22
  • realurl Version: 2.2.1
  • 写回答

3条回答 默认 最新

  • douou2026 2017-09-26 15:09
    关注

    Those caching problems are usually because of wrong or missing cHash.

    You can use $GLOBALS['TSFE']→reqCHash(); in your controller's actions. This disables Caching if no cHash is set, therefore making sure you don't get incorrect cache entries. Please note: If you set [pageNotFoundOnCHashError] = 1 in your system settings you will get page not found errors when the page is called without cHash, if it's set to 0 the page will still be displayed but not cached.

    Alternatively, there is a system parameter "[FE][cHashRequiredParameters]" - you can add your plugin parameters there. If no cHash is given but one of the parameters are set, then TYPO3 triggers the configured cHash Error behaviour. I believe cHashes are then set automatically for typolinks, you can try and see though. If they aren't set automatically you should set "useCacheHash = 1" on your links to the show action.

    I prefer & use the first variant.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵