Long Answer: The best time to attack on Deity is right after you've just spent a bunch of turns arming for that purpose.
You can get away with it at any time. The later it goes down, the easier it'll be... but the less likely you'll still be alive to make it go down.
I love the Archer rush strategy. I never get Iron hooked up fast enough on Deity, but I've had many victorious Sword wars on Emperor. Since others swear by them (must be the mass-upgrade thing), I'm forced to assume it's a good plan too.
The Middle Ages can be really tough. It's easy for the AIs to magically appear with Muskets right around the time your Knights are ready to roll, so you have to plan way ahead to make that happen.
Anything after then will probably be aided by Cavalry. Either you've got railroads to do that or your opponents have Muskets on defense. Either way, if you've accumulated enough forces, you should be fine.
Short Answer: "Right after a mass-upgrade."