Does OkHttp support HTTP/2 server push?

2019-07-29 03:45发布

I am developing an Android video streaming application using the OkHttp library and HTTP/2. I am investigating the possibility of using the server push functionality of the HTTP/2 protocol, but I am not sure whether OkHttp supports it or not.

I have a basic server implementation to test HTTP/2 push, which works without problems on the chrome browser (i.e., pushed content is stored in the cache and retrieved from the cache by the browser). When I use the Android application with the OkHttp library, content is not pushed anymore to the client's cache (which is initialized and working properly, by the way). Particularly, the client sends a reset stream to the server for each content the server would like to push.

Do you have any idea if OkHttp supports push streams? And in case it does support server push, are there any best practices to make it work? Thanks in advance for your answers.

1条回答
Summer. ? 凉城
2楼-- · 2019-07-29 04:15

Nothing currently. We’re rewriting the cache persistence and that’s a big effort. If you want to read the internals there’s callbacks for it, but they currently just cancel the pushed streams.

查看更多
登录 后发表回答