arthurfiorette / axios-cache-interceptor

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!

Home Page:https://axios-cache-interceptor.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: does it works for streaming requests ?

quentin-desbin opened this issue · comments

What happened?

It's just a question and maybe a bug.

I use axios to perform a request to my server, but my server returns an StreamingResponseBody (SpringJava), it means that the server will always returns a 200 directly, but the content is an outputstream written "asynchronously".

When using axios and axios-cache-interceptor, the answer saved in cache is empty.

It's recommended to use StreamingResponseBody when manipulating heave multiple assets (blob of images,files, etc.) but i'm not sure it's easily compatible in this case. What do you think about this ?

Thanks !

axios-cache-interceptor version

1.4.1

Node / Browser Version

Chrome 20.0.6099.12

Axios Version

1.6.5

What storage is being used

Web Storage

Relevant debugging log output

N/A

Hey @quentin-desbin i'm not sure if streams are supported. Probably you will need to add a response interceptor before the axios cache interceptor one to collect the entire stream into a data format it can handle like string or object.

#775 may also help too.