Search code examples
okhttphttp2

Does OkHttp support Link rel=preload header?


My team is working on making our REST API more 'hypermedia' by replacing compound documents with links to related resources. We'd obviously like to use HTTP/2 Server Push to make sure it's as fast as possible. However, because of our hosting provider, we are not able to run HTTP/2.

It seems like the second best option after Server Push would be to have the client prefetch related resources via Preload.

Does anyone know if OkHttp natively supports the Link rel=preload header?


Solution

  • It does not. But you should be able to enqueue these yourself by inspecting the headers.