WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions.
Click here to have your audio equipment measured for free!
I would give the hottest part the most space and - if possible - the most distance to other parts.
Maybe put a metal plate between every device to further improve heat dissipation or even a silent fan behind the rack.
Most devices I know don't get hot because of load but because of the time the stay switched on, so powering everything off when not needed is probably the best you can do in any case.
It's always a good idea to check the manuals for operating temperatures as well as any recommendations for cooling (like free distances for air cooling). In a warm room you might not be able to stack at all.
Some devices have small feet that blocks airflow underneath and in those cases it can be helpful to add feet that increase the height a bit. For my MOTO M2 that I put on top of my RME ADI-2-DAC FS I bought small feet to increase airflow a little, as without I felt it was too close to the top of the ADI-2-DAC. I bought these, and I'm sure you can find similar if you want.