title: AJAX works if chrome dev tools open but not if chrome web tools closed?
body: <p>I'm loading a json file via ajax. If Chrome dev tools is open, everything functions perfectly. If Chrome dev tools is closed it fails. Thankfully dev tools still keeps doing it's thing even when closed so I can still see the exception I get:</p>
  
  <pre><code>Failed to load resource: the server responded with a status of 412 (Precondition Failed) http://localhost/experiments/escape/maps/test.json
  </code></pre>
  
  <p>Why would there be a precondition on whether dev tools is open? Also, it seems unlikely that opening and closing the dev tools could in any way affect the server's behaviour so I think it is Chrome that is preventing the request rather than the server as suggested in the exception.</p>
  
  <p>Unfortunately, dev tools does not keep track of network activity when closed so I can't use the network tab to get any further info.</p>
  
  <p>The AJAX is handled via JQuery with the following code:</p>
  
  <pre><code>map.load = function(mapName, tileSource, tileWidth, tileHeight, onLoad) {
      $.ajax({
          url: '../escape/maps/'+mapName+'.json',
          type: 'post',
          success: function(mapData) {
              // there's loads of stuff in here but I don't think it's relevant to the question as the failure prevents the success method from being called.
          }
      });
  };
  </code></pre>
  
  <p>This code causes no issues in Firefox and so does seem specifically to be connected to Chrome Dev Tools. Any suggestions welcome as I'm completely flummoxed!</p>
  
  <p>EDIT: Ok so it's not dev tools fault at all - I had disabled the cache in dev tools, re-enabling it allows the script to work correctly. Why does my code depend on the cache? Disabling / enabling the cache in Firefox does not cause any issues</p>
  
  <p>EDIT2: Ok, I think I'm getting close. The precondition that is failing is the if-modified-since condition (the file hasn't changed). I assume that chrome is sending this to confirm whether or not to use the cached version, however, despite the precondition failing it does not load the cached version. I thought this might mean the cache was corrupted in some way so I cleared the cache. Unfortunately this doesn't solve the issue. The file will happily load once but on the next time I'm back where I started with the same issue. Any ideas?  </p>