Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hash 防止IE11在按browser';s";“后退”;按钮_Hash_Internet Explorer 11_Back Button - Fatal编程技术网

Hash 防止IE11在按browser';s";“后退”;按钮

Hash 防止IE11在按browser';s";“后退”;按钮,hash,internet-explorer-11,back-button,Hash,Internet Explorer 11,Back Button,我正在使用哈希路由(React router v3)编写一个React应用程序。我发现了一个错误,当按下浏览器的“后退”按钮时,IE11正在使用缓存的API响应。我正在使用fetchapi 我随初始请求发送的标题如下: const headers = { 'Accept': 'application/json', 'cache': 'no-store', 'Expires': 0, 'cache-control': 'no-cache', 'Content

我正在使用哈希路由(React router v3)编写一个React应用程序。我发现了一个错误,当按下浏览器的“后退”按钮时,IE11正在使用缓存的API响应。我正在使用fetchapi

我随初始请求发送的标题如下:

const headers = {
    'Accept': 'application/json',
    'cache': 'no-store',
    'Expires': 0,
    'cache-control': 'no-cache',
    'Content-Type': 'application/json',
}

在这种情况下,有人知道如何强制IE11发出新的API请求吗?

我最后添加了一个带有expires=“+Date.now()”的查询参数,以便它始终是唯一的,不会使用缓存。这种方法适用于IE11