I have always thought it might be possible to have a chemical foam system built into houses.
All you would need is a few holes along the roof ridge, some piping, and a powerful pump with a generator in the basement. When the fire gets close, flip a switch and cover your house with thick foam in a few minutes.
Should be doable for a couple of thousand.