There's a post I saw on reddit that points to the dimple on the side of a milk jug, and makes fun of all the people who don't know what that's for. In the comments are thousands of people giving dozens of different explanations, and all of them are wrong.
It is not there to indicate that the milk has spoiled by popping out due to gasses produced by spoiled milk. If there was enough gas to pop out the dimple, the whole jug would look like a balloon.
It is not there to provide structural integrity, like lateral support to prevent the bottles from crushing. The contents are under pressure, so if there was enough force on the jug from any direction, then the cap would pop off regardless of the shape in the sidewall.
The actual answer is that the dimple is added to ensure that all of the jugs contain the same volume of milk. Plastic jugs are blown into molds, and minor manufacturing variations over time would create jugs that hold different amounts of milk. Larger jugs would hold more than a gallon. They could just fill by volume, but consumers are wary of purchasing a bottle if it appears to be less full than the others. So they add the dimple to make it so that the level of milk is all the way at the top with minimal air between the milk and the cap.
You can verify this yourself by finding different jugs from the same supplier with dimples of different depths, or even no dimple at all. None of those other explanations would explain dimples of different sizes or jugs without dimples.
TLDR everybody is wrong. The milk jug dimples are added to ensure the jug contains the correct volume of milk.
It's a US thing. A gallon of milk will last my family about two weeks, or less if the kids are into baking or breakfast cereal that week. I sometimes put a little milk in my coffee or tea, and I occasionally use some for making sauces or marinades. Very rarely will we throw away milk because it has spoiled, but it has happened. Maybe once a year or so, usually because of a power outage or having to travel unexpectedly.
We also have half-gallon plastic jugs which feature the same dent sometimes. When I was a kid, I remember we even had tiny pint-sized jugs for half and half, but I think that was more of a novelty.
Wait.....the rest of the world doesn't have hard jug gallons? What do they use instead?
In Canada, they use gallon sized plastic bags
I've lived in various provinces in Canada. West of Ontario I really only see the waxed-paper cartons or the plastic jugs, stores carry both equally. Eastern Canada carries the plastic bags (and everyone has a plastic container at home they place them in after snipping the bag corner) and often the cartons. Bit weird the custom changes across Canada, and coming from the west I was very confused about the bagged milk when I first moved to Ontario.
Maybe someone else can comment on their experiences. I've never seen bagged milk in a store in the prairies (but I only lived in major cities).
They had milk in 1.3 L bags (sold in packs of 3 for 4 L) in Manitoba about 35 or 40 years ago.