UE4 upgrade advice (avoiding HUGE compile times)

Hi, I’m relatively new to Unreal, and I’m considering upgrading my hardware.

If I had to choose between buying a decent SSD (currently I don’t have one), upgrading my RAM, or an intermediate solution (or another): what would help me out in the long run (or medium term) in UE4? As for SSD I don’t know if it is best to get an external SSD or an internal one, and If it’s better to connect it at the back part of the desktop pc or in the front part.

My main issue is HUGE compile times. My first UE4 build lasted about 10 hours on VS2019!
I don’t know if it was due to not using UnrealVS extension or quickbuild.

My general specs are:
Intel i7 7700
Intel HD Graphics 630 (note it is not UHD).
4 cores
8 logical processors
3.6 Ghz
1 Tb of HDD
8 GB of RAM (can upgrade up to 64, Im using 2 of 4 ddr4 ram slots)

This are my pc specs. Note the price is in mexican pesos (about $500 US):

Thanks in advance!