speed up template download: don't sync io for each write