I am writing a website in Mojolicious which needs to route to certain files depending on the domain name. Ie:
mydomain.com/foo -> controllerA#foo
mydomain.es/foo -> controllerB#foo
The documentation gives the following solution:
$r->get('/foo')->over(host => qr/mydomain\.com/)->to('controllerA#foo');
$r->get('/foo')->over(host => qr/mydomain\.es/)->to('controllerB#foo');
But also warns me, that this will disable route caching.
Is there a better way to do this? And if not, how bad is it that route caching gets disabled? This website needs to be able to handle a lot of requests (up to 10.000/hour), so I could imagine that route caching was preferred.
Thanks!