title: Retrieve response text of a request that has already been made
body: <p>In my <a href="https://stackoverflow.com/questions/43829832/get-html-document-as-string-before-it-has-loaded">question from yesterday</a>, I asked how to retrieve the full HTML content as text. Seems like XHR is the way. Now, however, I have a different problem.</p>
  
  <p>I use this code to retrieve the content of the document as a string:</p>
  
  <pre><code>var req = new XMLHttpRequest();
  req.open("GET", document.location.href);
  req.onreadystatechange = function () {
      if (req.readyState === 4 &amp;&amp; (req.status === 200 || req.status == 0)) {
          console.log(req.responseText);
      }
  };
  
  req.send(null);
  </code></pre>
  
  <p>However, there is a slight delay that I'd like to avoid. I'm testing on localhost and Chrome DevTools says there's several milliseconds of "Stalled" time. In the "Size" column, it says "(from disc cache)", so I know I'm requesting something that the client already has.</p>
  
  <h2>Questions</h2>
  
  <ul>
  <li><p>Since the request is about something that already exists, can I somehow make the response instantaneous?</p></li>
  <li><p>Can I access the original request (the one that is fired after typing the website URL) and access <em>its</em> response text?</p></li>
  </ul>
  
  <p><strong>My goal is to get the document as a string as soon as possible and without waiting for the DOM to load.</strong></p>