There could be a flag included in the HTTP response header (X-Batch-DOM) or a meta tag like &lt;meta http-equiv=&quot;X-Batch-DOM&quot; content=&quot;1&quot;&gt;. The response header would be a better place for that flag since you can stick a meta tag at any point in your markup (even where it&#x27;s incorrect to do so). The browser could choose to ignore the meta tag if any JS has executed or it could reload the page with the setting turned on. Not ideal. Anyway, if you feel completely sure that your code would not do anything like you&#x27;ve demonstrated then batching might work fine. Though this basically excludes the safe use of externally linked scripts that you can&#x27;t control (analytics is one example).