The longest war in history lasted from 1650 to 1985, between the Netherlands and the Isles of Scilly (located off the southwest coast of the United Kingdom).
The Dutch had declared it against the Royalists there during the Second English Civil War, and then forgot about it. In 335 years, no shots were fired and no lives were lost.
The shortest war was the Anglo-Zanzibar War, fought between the United Kingdom and Zanzibar in 1896. It lasted 45 minutes. Kudos.