title: AJAX GET request is not cached by browser
body: <p>I'm trying to configure caching for slow API requests. I've found that default cache configuration doesn't work for my case.</p>
  <p>My Nginx server has the following configuration:</p>
  <pre><code>location /api/get_data_from_cache_with_timeout2sec {
      expires 10m;
      proxy_pass http://myapp;
  }
  </code></pre>
  <p>Server response has the following headers:</p>
  <pre><code>cache-control: max-age=600
  expires: Mon, 29 Jun 2020 14:56:31 GMT
  </code></pre>
  <p>And page makes AJAX request with this code (this is just a simple example):</p>
  <pre class="lang-js prettyprint-override"><code>jQuery.get('/api/get_data_from_cache_with_timeout2sec', null,
              function(data, status, xhr) {});
  </code></pre>
  <p><strong>How I expect it should work:</strong></p>
  <p>The browser should recognize ерфе the content should be cached. The browser should get the data from the cache, and it should be faster than 100ms for the second request (using browser cache).</p>
  <p><strong>How it works:</strong></p>
  <p>Every time browser spends 2 seconds to get the content, and the browser doesn't try to cache the content for this request, and it doesn't provide the content from the cache for the user.</p>
  <p>What should I change in configuration or code to make it possible to cache such requests with a browser and make it faster? Thank you!</p>
  <p>Please find the example page where you can reproduce it (just click the &quot;Check Now&quot; button several times):
  <a href="https://www.iwebtool.com/cache_example" rel="nofollow noreferrer">https://www.iwebtool.com/cache_example</a></p>