We were recently trying to migrate our app behind an AWS elastic load balancer (ELB). Due to some configuration issues, the ELB started genrating 504 Gateway Timeout error on the browser.
As a result, we decided to remove ELB and go back to our original configuration. Essentially we changed our DNS A records. However, browser (Chrome in this case) continue to give use 504 error. We could visit our app in incognito mode or using another browser which had not seen 504 error.
The only solution was to clear browser cache/cookies (clearing cache alone did not work). After performing this step, everything was fine.
I am still perplexed by this issue. How is browser not able to redirect after DNS record changes? what has cookie got to do with this?