title: Returning data in a HTTP Response outside the HTML?
body: <p>Basically, I want the server to be able to send some data back to the client, except that this data will only become available after the entire HTML blob has already been generated. Specifically, I want to put a time-to-render (TTR) indicator on every page:</p>
  
  <p><img src="https://i.stack.imgur.com/GGTzN.png" alt="enter image description here"></p>
  
  <p>Currently the time is being measured from the point the first component starts rendering up to the point at which the last component is rendered. However, this misses out on the time needed by all the other stuff like middleware (I'm using Django) that goes on before/after the main HTML Blob is rendered.</p>
  
  <p>If i measure it from the final post-post-processing point, I cannot just append the TTR string onto the HTML blob because the final /html tag has already been done. I could possibly do some clever regex-string-replace-thingy to insert it <em>inside</em> the blob, but that feels very dirty. </p>
  
  <p>I could just <em>not</em> append the closing /body /html tags until this stuff is done, but that feels equally dirty: I'll have to purposely split off the "closing" tags of the main page from the rest of the page just so I can put the TTR indicator before those tags.</p>
  
  <p>Is there anyway I could have a fully formed HTML page, and just tack on some tags <em>after</em> the final /body /html tags that would contain this information, that I could Javascript into my TTR div, while having it still be valid html? Or is there any way to pass back metadata along with the HTML blob, which my Javascript could read and also place into my TTR div? Or is there any other better way of doing this that I am completely missing out on?</p>