Today building science teaches us that spraying the roof deck is the best way to control temperatures in your attic space so your heating and air ducts operate more efficiently. Today nearly all of the residential homes or commercial buildings that are designed by architects specify that foam be applied to the back side of the roof deck instead of the flat ceiling. Research has been done by large manufactures of shingles like Owens Corning, that this does not effect the lifetime of the shingles and does not effect the warranty.