I've been playing on a rack since the early 80s. Simply put, there is nothing you can do about the resonance a rack generates, although I have never tried spray foam, and am scared to, because if I try it, and it does NOT work, I don't want the headache of trying to remove it from the myriad of rack bars I use. In fact, if the resonance was a REAL issue, I would think DW or Gibraltar would have addressed it by pre-filling their racks tubes with the stuff.
That said, I do not have ANY rattling of any kind, be it cymbals or hardware. You can, however, detect the resonance across the rack IF you hit a crash and nothing else, and then listen close enough for the sound to travel through the rack. But, rest assured that none of it is picked up my mics when recording or playing live.
In fact, I have 48" uprights and have mic boom arms with two overhead condensers inserted into the tops of them, and fly my vocal mic boom off the left upright as well, via a Gibraltar Multi-Adjust Multi-Clamp. I fly 3 crashes off those uprights ,too. If I stand right in front of my kit and have someone hit one crash, and only one crash, if I listen carefully, I can hear the vibration of the cymbal resonate through my rack. However, I can NOT hear any resonance when the kit is played, let alone when the full band plays.
Being that I use in-ear-monitor (IEMs), I ALWAYS fully mic my kit. Along with the overheads, each drum has it's own mic mouned directly to the drum. We record all rehearsals and gigs, and I have never once heard any of the resonance on the recordings, even when a song opens or ends with a solo crash.
When I first started mic'ing everything, I ran a boom from a crossbar down to my kick. Everything sounded fine in the rehearsals. Part way through the first gig I did with that setup, we started getting feedback. We couldn't figure out where it was coming from, and could only solve it by turning everything down. At the end of the night, I decided to troubleshoot it. Turned out it was coming from that mic. When I moved the mic to a stand, the feedback went away. In fact, it was then that I realized the resonance in the rack. I never noticed it before that.
Shortly thereafter, I started using a Kelly Shu, which suspends a mic inside the kick drum, and never had that problem again. But, once I knew the resonance was there, I became obsessed with it, and tried to find a cure (even though you can't really hear it). I even bought 3 Gibraltar mic shock mounts. These are little adapters that put a short piece of solid rubber between the boom arm and the mic clip, so there is no longer a straight shot of metal running from the mic to the arm and rack. I use them on my overheads and vocal mics, which as I mentioned, are attached to the rack. While they probably do isolate the mics a bit, I noticed no sonic difference whatsoever. But, then again, like I said, I didn't previously hear the resonance on any recordings. In fact, since I use ambient-sound-isolating IEMs, and with these I hear every little nuance that people listening to monitors don't hear at all, and I still do not hear ANY resonance from the rack.
Sorry so long, but I thought I'd share this to save you from becoming obsessed with the resonance like I became... for naught.
FWIW, I run a Tama Power Tower, which is made of brushed stainless steel ROUND tubes, which I would think would make resonance a bit more prominent than a square tube rack, so if recordings don't pick up anything on my rack, I don't think you'd hear any of it with a square-tubed rack, either.
And, if you start thinking that more tubes make it worse, and consider reducing the number of rack bars, think again. Until recently, I had a 3-tiered rack with 2 side wings. Connected to my 48" uprights were two extension bars, and the top tier was connected to those. That top tier held 3 cymbals, one of which was a ride, my two overheads and my vocal mic boom. The middle tier held 3 electronic triggers. The bottom tier held 3 rack toms. Connected to my left side wing is a legless hi-hat stand, which I still use today, a sizzle ride, and a an electric snare trigger. My right side wing holds a ride and China. Oh, and I also have connected down low on my left upright, a 30" bar to which my legless snare stand is connected. And, with all these bars, I still could not hear any resonance while playing, nor did any recordings reveal even the slightest hint of it.
I absolutely love racks. More flexibility than any other mounting, and consistent setup EVERY single time. I refuse to play without one. In fact, along with everything else I play, a church at which I play in a contemporary worship band has a rack just for me. But, being the ANAL person I am, believe me when I tell you, if the resonance could be heard by me live or recorded, I would have stopped using a rack immediately.