Skip to content
Snippets Groups Projects
Commit 7cc916ee authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Stateless SiteFinder

The SiteFinder is an often injected service, but
its stateful due to cache properties and suffers
from improper cache eviction when SiteWriter
changes site configuration.

Note the overall class construct / separation of
SiteConfiguration, SiteFinder and some related
classes is a bit unfortunate and naming is not
perfect. We may want to review these constructs
in v14 again.

* Avoid sites property altogether since it is a
  1:1 call of SiteConfiguration->getAllExistingSites(),
  which has its own cache.
* Declare readonly.
* Use runtimeCache for "root id to identifier mapping",
  get runtimeCache injected.
* Avoid loading all sites within __construct()! Do this
  on demand instead.
* Listen on SiteConfigurationChangedEvent (by SiteWriter)
  to remove the runtime cache for automatic cache eviction
  on site changes.
* Adapt some test cases.

Resolves: #105264
Related: #105263
Releases: main
Change-Id: Idea0f3d487b32a6b552f77ac52c539d6c793cd35
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86548


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 5f686eb0
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment