There are ways to decrease the initial response using things like opcache (if it's not enabled already) using a more optimized composer autoloader (I use the -a
option instead of -o
which seems to have no issues on Flarum. Using the latest version of PHP (7.4) also helps a tiny bit. (opcache has a WAY larger impact than the other two things)
Another big thing, especially to Flarum, is the database optimizations, I highly recommend doing some good reading on MySQL server optimizations for both MyISAM and InnoDB (we currently use both), just for some context, Flarum is mostly "read" and not "write" so you'll want to optimize for "read" speeds.
There are however plenty of things out of your control, notably network latency in the datacenter, latency in the route used for the traffic, etc. You can somewhat mitigate these issues with geo-diverse, clustered servers, however that's only reasonable for really big installs.