Is it possible to cache binary data?
ouyuran opened this issue · comments
I've tried to cache an image url but failed.
const res1 = await api.get(image-url);
const res2 = await api.get(image-url);
console.log(res1.request.fromCache);
console.log(res2.request.fromCache);
console.log(await api.cache.length());
The output is undefined, undefined and 0.
I think the reason might be it uses JSON.parse(res.data)
to serialize data before setItem
.
What's more, can we try to cache the response with content-type stream?
If you you guys think they are valuable features I'll be happy to implement they.