禁用 ServiceStack 304?
我有一个 IService,当 jQuery.ajax 在 IE 中请求它时,ServiceStack 总是返回 304 并且不执行我的服务。我尝试过 ResponseFilters,切换到 RestServiceBase,并通过 HttpResult 返回 200。我缺少什么?
已解决。
ServiceStack 正在正常工作。我曾尝试使用 ResponseFilters 添加 CacheControl: no-cache 标头,但令我惊讶的是,我不断收到 304。然后我意识到这是因为没有 Cache-Control 标头的原始响应位于 IE 的缓存中,因此出现了 304。清除 IE 缓存后一切正常:-)
I have an IService that when jQuery.ajax requests it in IE, ServiceStack always returns a 304 and doesn't execute my service. I've tried ResponseFilters, switching to RestServiceBase, and returning a 200 via HttpResult. What am I missing?
Solved.
ServiceStack is working as it should. I had tried adding the CacheControl: no-cache header using ResponseFilters, but to my consternation I kept getting 304s. Then I realized that was because the original response withouth the Cache-Control header was in IE's cache, hence the 304s. Clearing IE's cache got everything working :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论