compile, cache and send templates in initial load