title: How to get past CloudFront cached redirect and hit API Gateway instead?
body: <p>I have a CloudFront distribution set up so that <code>&lt;domain&gt;/api</code> redirects me to <code>&lt;api-gateway-url&gt;/&lt;env&gt;/api</code>. However I find that sometimes CloudFront caches responses to GET requests and the browser does not redirect to the API Gateway endpoint and returns the cached response. </p>
  
  <p>Example: <code>/api/getNumber</code> redirects to <code>&lt;api-gateway-url&gt;/&lt;env&gt;/api/getNumber</code> and returns me 2. I change the response so that it should return the number 300, but when I make a request through my browser now there is no redirect and I still get back the number two. The <code>x-cache</code> response header says cache hit from CloudFront.</p>