There is a wiki description of how to make a caravan friendly trapped path, and it's worked for me (contradicting wuphonsreach's conclusion):
XXXXXXX
XXXXXXX
XXXXXXX DDDDD
XXXXTXXXTXXXXDDDDD
XXXXTXXXTXXXXDDDDD
XXXXTXXXTXXXXDDDDD
XXXXXXX DDDDD
XXXXXXX
XXXXXXX
Note that I'm using the current version, though. If your area is generally safe, you might want to put the depot off to the side of your fortress with a drawbridge to close off the path to it, basically betting on there being no trouble most of the time, and sacrificing the caravan if need be.
I'm currently redesigning to give the caravans a separate entrance to the depot, one that I'm going to keep closed with a magmasafe drawbridge unless a caravan is in- or out-bound. That way I can trap my main entrance to hell and back without impeding caravans, and you can trap the path from the fortress to the depot, of course.
I'm also walling off and decking over first my outdoor farming area (done), and then my pasture (working on it), but that takes some more time which I guess you don't have. I would guess the first siege usually would not contain flyers, so a wall at least 2 z-levels high (I think climbing one tile is no problem) with no trees to provide a path over ought to be sufficient to keep the first wave off your cattle (Warning! this is a guess, not knowledge). As been noted elsewhere, one time sunshine, always sunshine, so decking over is safe from that perspective (but hostiles get more dwarves to catch outside while they're working on it). I'm still waiting for my first siege, but my current guess is that it will happen during the winter, since that is the goblin season. The decking project is on a tight schedule...