The persians used the structure in the picture called a yakhchal, to keep ice, food, and water cool. Beneath the structure was a subterranean pit for storing the ice, with a trench in the middle to collect melted ice. Thick walls (at least 2m thick at base) and the good insulating properties of the sārooj (a special mortar).  Water also trickled continuously around the sides providing additional cooling via evaporation and during the night, the cool temperatures would refreeze ice that had melted. (The reason for the big temperature swing is because sand is a good conductor of heat, so it heats up quickly, but also cools down quickly once the sun has set)