Really slow boot up using wifi dongle and realtek drivers

I’m putting together a wifi only networked project.
It works, but the wifi takes a long time to connect during boot.
If the network cable is connected and I’m not using wifi, it boots within seconds.
If the network is not connected and it boots and connects to my wifi router, it takes about a minute or two.

Is there a way to speed this up?
Make it connect in the background after it has booted up?