c# - Internet Explorer 缓存从数据库返回的数据

标签 c# asp.net-mvc-2 caching jquery internet-explorer-9

所以我遇到了这个奇怪的问题。当我在本地开发并在 Firefox 和 IE 中运行我的应用程序时,一切正常。

当我在我们的集成环境中运行这个应用程序时,Firefox 没有看到这个问题,但 IE 有。基本上发生的事情是,我们为用户提供了通过 AJAX 调用在数据库表中存储新行的选项。 AJAX 调用是通过 JQuery 进行的,由我们在 C# 中的 Controller 吸收,然后一些信息被发送到 proc 并存储在 DB 表中。一旦发生这种情况,我们都可以验证此数据确实已存储。

还有在应用程序中查看表格的功能,该表格基本上模仿了我们刚刚存储数据的表格,也可以通过 proc(select 而不是 insert/更新)。现在,当我们插入新行后立即查看时,Firefox 会在 Web 表格上显示新行,但 IE 不会 - 即使两者都在本地工作,只有 Firefox 在集成中工作 - 太奇怪了。

现在,如果用户插入新行然后清除他的 IE 缓存,他可以在单击链接时看到新行出现。

所以我的问题是:

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?

谢谢你们。

最佳答案

将 ajax 调用的 cache 属性设置为 false,如此处记录 http://api.jquery.com/jQuery.ajax/

关于c# - Internet Explorer 缓存从数据库返回的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8170391/

相关文章:

php - Laravel 类 'Memcached' 未找到 Illuminate\Cache\MemcachedConnector.php 第 44 行

c# - 如何验证 Zebra 打印机是否使用 ZPL 和 C# 成功打印(或能够检测错误)?

c# - 在 C# 中,=> 符号的含义

c# - .NET Core 2.1 Web API 模拟在处理错误时导致 WSALookupServiceEnd

c# - 在 SQL to LINQ 中使用 SP 时从 SQL Server 检索错误消息

asp.net-mvc-2 - 将参数传递给 MVC Ajax.ActionLink

asp.net-mvc - 表单提交不提交部分 View

php - MemCached 与磁盘缓存的性能比较

php - 如何在 PHP 中的多个 get 请求之间共享对象?

c# - WinForm 应用程序事件处理程序