Setting asyc or defer on script tags

async or defer can easily be added to the script tags generated in index.html, by changing the clause in index.tpl to

		each script in scripts
			if script.src
				script(src=script.src async)
			else
				script!= script.contents
Nothing obviously breaks if I do this.

However, I'm curious why such a straightforward performance enhancement is not the default. Are there concerns other than older browsers? (My app doesn't support anything without IndexedDB.) Is there a reason to choose async instead of defer?

Comments

Sign In or Register to comment.