Unless your site is really huge and you have users all over the globe you probably wont need a CDN. Instead follow the steps mentioned by e.g. luceos and review the config of your server setup (nginx, php, db). Also don't forget to enable compression and HTTP/2. The latter helps with hosting your own assets especially on slower (mobile) networks.
A default Flarum install should get you A ratings accross the board. (though performance regresses heavily on very long discussion threads)