Exactly. The best defense after attack itself is defense-in-depth.
I've already mentioned Japanese defense and fortresses in the Pacific but I very idiotically forgot about marshal Kesselring's master defense of Italy.
Using mountains, river, hills, towns, blowing up and mining everything, along with defending strategic spots and ocassionally counter-attacking. Kesselring was definately one of the greatest geniouses of defense in warfare!