HMS Thrush which led the shortest campaign in naval history.
We looked. There seems no debating the consensus. The shortest war in recorded history looks to be about 38 minutes. Who had the stopwatch that was tracking all of this is an open question, but no one seems to be questioning their judgment.
The Anglo-Zanzibar War (1896) was, by all accounts a quick win for the visiting team.
What happened? In 1890, Britain declared Zanzibar a protectorate and installed their own Sultan. He was a lovely fellow, but died three years later. His cousin moved in and took over without British approval. That got London’s attention. the government dispatched two British ships. They entered the harbor demanding the new “sultan” leave the palace. He refused. On August 25, at 9 am the order was given to open fire. Firing commenced at 9:02. The “new” Sultan surrendered at 9:40. By then all the cannon defending the city had been knocked out and the palace was on fire.