Reputation: 24052
So I'm running into this weird issue. When I'm developing locally, and I run my application in both Firefox and IE, everything works fine.
When I run this application in our integration environment, Firefox doesn't see this issue, but IE does. Basically what's happening is, we give our users the option to store a new row in a database table through an AJAX call. The AJAX call is made through JQuery, absorbed by our controller in C#, and then some info is sent to a proc and stored in the DB table. Once this happens, we can all verify this data has definitely been stored.
There is also functionality to view a table in the application that basically mimics the table where we just stored our data, also accessed via a proc (select
instead of insert
/update
). Now, when this is viewed right after we insert the new row, Firefox shows the new row on the web table, but IE does not - even though both work locally, only Firefox works in integration - so weird.
Now, if the user inserts the new row and then clears his IE cache, he can see the new row come up when he clicks the link.
So my questions are:
1) Should I focus on a way possibly in JQuery, to clear the browsers cache everytime the user clicks the link to view stored rows?
2) Why would this be working in IE locally but not on the integration server?
3) Is there anything server side I can do within .NET, like possibly a property I can set on the controller methods that both set/view these rows that set IE to ignore cache or something?
Thanks guys.
Upvotes: 2
Views: 194
Reputation: 30902
Just use the POST verb on those requests that are cached. IE caches GETs but POSTs are OK.
To achieve this add the [HttpPost]
attribute to your actions.
Upvotes: 0
Reputation: 515
Set the cache
property of the ajax call to false as documented here http://api.jquery.com/jQuery.ajax/
Upvotes: 1