【IE浏览器】GET请求防止读取缓存数据的解决方法

方法1:

  设置请求头(axios封装中)

config.headers['Cache-Control'] = 'no-cache, no-store' // 清除缓存

config.headers['Pragma'] = 'no-cache' // 清除缓存


方法2:

  URL后加数学随机数 或者 时间戳

?time=new Date().getTime()  // 时间戳

?number=Math.random()  // 随机数

猜你喜欢

转载自www.cnblogs.com/jackjo/p/9244857.html