使用超级代理缓存时如何强制更新?

How to force update when using superagent cache?

我正在使用 superagent-cache 和 superagent。

对于我的大部分请求,我使用这个:

import superagentCache from 'superagent';
const superagent = superagentCache();

superagent 正在按预期使用缓存。

对于某些请求,我想使用超级代理而不是缓存。

import superagent from "superagent";

但即使是那些请求,superagent 也会继续使用缓存的响应。知道为什么会这样吗?

superagent-cache 修补现有的 superagent。所以,不可能有原始的超级代理人。

要避免缓存或强制 AJAX 请求,请在 superagent-cache 上使用 forceUpdate 参数。