You're making this out of DOM and not HREW, right? What size, what thickness? Do you have the chop saw/bender/welder/notcher or are you paying for stuff to fab'd?Triangles are your friend, and keeping it simple helps while actually trying to bend and notch and weld it all together....
I'd pick neither. If you're making it as an actual cage to save your life, put it inside the cab and not behind it, especially if you're limited on tube. The top of cage to somewhere between the top of the engine block and top of the radiator is all likelyhood the angle you upside down rig could be sitting at. If your (or your passenger's) head has any chance of moving into that zone, it probably will if you're rolling the rig over and trying to fight gravity. If it's just for show, a simple hoop behind the cab and some stiff legs down to the back of the bed and tie it in to the frame.
Don't get me wrong, I'm no master cage builder, engineer, or journeyman welder. I just see it as putting the cart before the horse if you're building it as a safety device and not something to look pretty while it takes up cargo space in the bed. You've got a hard top on the rig, and that should help somewhat if you roll it, but if you're wheeling it and you feel like you might need some protection, why not start out right and put it where it'll do the most to benefit you?
My vote goes for in the cab.
65 Wagoneer: Chevy 350/TH400/D20 D60F Corp14R - cage: 70% fuel system: 50% electrical: 10%
06 Wrangler Unlimited: a locked rear D44 and enough lift to stuff 35" tires