【问题标题】:Angular get request is taking data from cache in IE 11Angular get 请求正在从 IE 11 中的缓存中获取数据
【发布时间】:2020-03-23 06:50:12
【问题描述】:

get(config): 可观察的 {

const headers = new HttpHeaders({
  ...config.headers,
  'Cache-Control': 'no-cache',
  'Pragma': 'no-cache',
});

const url = config.url;
let response = this.httpClient.get(url, { headers, params : config.params });

return response;

}

我已经使用了添加标题的解决方案{ 'Cache-Control': 'no-cache','Pragma': 'no-cache',} 用于 AJAX 调用。

【问题讨论】:

  • 那么什么你现在的问题是什么?
  • get 调用正在从 IE 11 的缓存中获取数据。它在 Chrome 中运行良好。我已经添加了标题,但仍然遇到同样的问题。
  • 也许这个github.com/jhipster/generator-jhipster/issues/777可以解决你的问题。

标签: angular ajax get


【解决方案1】:

尝试将以下标头添加到您的请求中:

{'Expires': 'Sat, 01 Jan 2000 00:00:00 GMT'}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-04
    • 1970-01-01
    • 2019-07-01
    • 1970-01-01
    • 2019-07-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多