Support for multiple domains
Currently the Flow does not support multi-domain setups out of the box:
- There is no concept of "domains" in Flow yet
- The Routing Framework only uses a combination of the (hashed) Request path and method as cache identifier for incoming routes
- How should linking to other domains than the current work? Probably the UriBuilder (and thus all uri/link-ViewHelpers need some "domain" argument)
Like done with the filterable request methods (#27117) we could add a new routing configuration:
- uriPattern: 'some/uri/pattern' defaults: '@package': 'TYPO3.Flow' domain: 'somedomain.tld'
But I wonder: Should this support multiple domains? or some regex-/placeholder-syntax?
Besides I'm struggling a bit with adding to many configuration options.. We'll soon need yet another one for the protocol (#44891).
A more generic approach (like I started with https://review.typo3.org/#/c/19742/) would be very flexible. But it has a bad impact on performance because all "filters" can change the caching identifier..
Get basic multi-domain support today¶
You can get multi-domain Routing working by creating a custom RoutePartHandler that only matches/resolves when the domain is one of the configured. But then you have to disable the Routing Cache in Caches.yaml::
Flow_Mvc_Routing_FindMatchResults: backend: TYPO3\Flow\Cache\Backend\NullBackend Flow_Mvc_Routing_Resolve: backend: TYPO3\Flow\Cache\Backend\NullBackend
NOTE: You should only do so if you absolutely know what you're doing. Disabling the Routing Cache can have a really bad impact on the performance.
Another way to get basic support for multiple domains is to use a (sub)context for each domain (Configuration/Production/Domain1/Routes.yaml, Configuration/Production/Domain2/Routes.yaml). But this won't solve the cross-domain-linking issue.