I have an ASP.NET page that includes some jQuery/javascript.
When the page loads, it does an $.ajax()
call (to a different "api.aspx" page) to fetch some data to populate the page. I also run an interval to periodically re-fetch the data to update the UI.
All ajax is performed by the same code.
Both pages are on the same server, no CORS issues.
But here's the strange thing, for which I need help:
- On my main (AWS EC2) server, the ajax call always returns 200, both on page load and on the interval calls.
- However, on an IIS/ASP.NET server that we set up ourselves, the 1st ajax call (on page load) always returns HTTP200, then the interval-driven ajax calls always return HTTP404.
I've checked the ajax URLs - they are identical.
Because this works perfectly on the AWS server but not on the server I set up, I suspect that this is due to an IIS and/or ASP.NET server config thing. I've done ajax a zillion times and have never seen this before.
Though I'm an expert developer (on both the C# and browser sides), I'm not expert in the "IT" (server config) side of this.
Has anyone else ever seen such behavior? Any ideas on what IIS/ASP.NET settings might be affecting the reliability of an ajax call?