Victorious on the bloody battlefields of the Great War, notably the Battle of Vittorio Veneto, he rose in time to the highest rank in his country, Marshal of Italy; he was also a Senator of the kingdom.
Caviglia took part in the African campaign of 1888/89 in Eritrea as a First Lieutenant in the II Artillery Regiment; in 1891 he was admitted to the War School.The year 1893 saw him promoted to captain.
In 1912 Caviglia was sent to Tripolitania and Cyrenaica; his task was to oversee both the negotiations for the pullout of Turkish troops resulting from the Italo-Turkish War and the pacification of Arab and Berber chieftains.
On 14 June 1917 Caviglia was promoted to lieutenant general for his merits on the battlefield: in August, as commanding officer of XXIV Army Corps, he overran the Austro-Hungarians on the Bainsizza plateau, the most brilliant Italian advance in the Eleventh Battle of the Isonzo.
After the disastrous Twelfth Battle of the Isonzo, in which he had no responsibility for the defeat, Caviglia received the Silver Medal for his skill in keeping his men united and disciplined throughout the retreat to the Piave line, contrary to what happened in large sectors of the Italian army.
When Gabriele D'Annunzio occupied Fiume with his "legionnaires", Caviglia was called to replace general Pietro Badoglio, dating from 21 December 1920, as troop commander and extraordinary commissioner in the Venezia Giulia.
By this time he had developed an intense dislike of Badoglio (who was defined by him once as "a barn dog that goes where there is the biggest morsel"), who had left him in dire straits thrice: in Caporetto (1917), in Fiume (1920) and then finally in Rome, benefiting in the meantime of the favors of the Fascist regime.