Some advice..
Unless your embark is extraordinary, you have spring->winter to get yourself ready. Use those first few months wisely.
Typically, this involves:
Moving your entire fort underground, exclusively. This means there is no reason, of any kind, for any dwarf to go above ground, ever. Included in this are two burrows. One which includes the entire map, and the other which includes only the safe parts of your fort.
If you tie these burrows to alert states, you can force all your dwarves to immediately move to the safe part of the fort, no matter what they're doing, at any time. Burrows are awesome in this regard.
A single locked door will hold off an entire siege (or any animals) if there are no building destroyers. Even if there are building destroyers, a single wall built of a block can hold off an entire siege, if you have a chokepoint in the right place, and is built quickly! In the worst case, you can build the wall immediately behind the door, while the door is being destroyed.
Traps, even those made of wood or glass, are remarkably effective at deterring most sieges. Glass is infinite if you have magma, wood is ~infinite if you have a tree farm, and/or clear-cut your entire embark. copper/iron/steel/candy trap components are good->ridiculously effective.
With respect to the caverns, if the only thing you're getting from the caverns is wood, breach them and seal them, then excavate your own tree farm in the soil layers beneath the embark layers. If the only thing you're getting from the caverns is water, you can build a secure water supply before invaders arrive, or use a partial aquifer for the simplest safest water supply.
Having your military train at your entrance (and yes, you should only have one entrance) is likely your safest bet. Having metal armor (of any kind, even copper) on every body part is really important when dealing with goblins, trolls, and animals. Iron is good, Steel is best. Not every embark is steel friendly, but you can always request it from your caravans, as a last resort.
Cave in traps will kill -anything-. They're cheap and easy to make, and are among the simplest defenses against forgotten beasts, titans, dragons, demons, etc. Done correctly, they're also quite easy to reset/rebuild.
Upright metal spikes in your entrance path, tied to a secure lever in the safety of your fort is one of the greatest "last ditch" defenses in the game. Engage the civilian alert to drive the dwarves into the burrow, lock the door exterior door/drawbridge, and set the lever to: Pull lever - repeat. Everything standing behind the door (between the outside and the locked door/drawbridge) will now be perforated repeatedly until dead.
If that's not clear, I can provide some diagrams or a sample fort.