TYPO3 9: Adding no_cache parameter in url disables cache

4.5k views Asked by At

We are using TYPO3 9, and we see a lot of warnings in the log file that the cache is disabled. I see that this is because a lot of urls are called with an added no_cache=1 parameter. I disabled all no_cache=1 configuration at my system, but the log grows up in case of these urls.

Is there a way to disallow calling the urls including the no_cache parameter?

Many thanks.

2

There are 2 answers

0
Waldgeist On

no_cache is sometimes added if the page, the plugin is inserted in, has been configured in the page settings to have the cache disabled. If the cache has been disabled for the page, all links pointing to that page will have no_cache=1 added.

1
Jonas Eberle On

As @Julian Hofmann pointed out, you can disable the functionality in the InstallTool ([FE][disableNoCacheParameter]). That means that this parameter is just ignored and the page is rendered cached. There's a warning on it, though: InstallTool Installation-wide settings

Anyways, the backend relies in parts on these URLs. See the comments on https://review.typo3.org/c/Packages/TYPO3.CMS/+/54508 for a proposed change to the default configuration (which was rejected for now). The parameter is prone to be gone in the next TYPO3 version.

As a workaround for TYPO3 until v9, you could enable the option and add a TypoScript condition that disables caching for all logged in backend users.

[backend.user]
  config.no_cache = 1
[end]

Mind that the warnings would still be in the log then, but it is not exploitable for non-backend users to hog your server.