Search code examples
apache2.4http2nghttp2

when i make an http2 push, i make an request to the server?


I have a server with http2 an i have configured a push of 4 images when some client request the index.html, and it works, but i have seen on the access_log of apache that the client makes some requests of the images. Is it correct? I mean, i think that the access_log should have only a request of the index.html, and the client gets the responses of the index and the pushed images, but not requests of the pushed images.

This is what my access_log has:

127.0.0.1 - - [24/Jan/2016:14:33:30 +0100] "GET / HTTP/2" 200 290
127.0.0.1 - - [24/Jan/2016:14:33:30 +0100] "GET /images/pele.jpg HTTP/2" 200 299013
127.0.0.1 - - [24/Jan/2016:14:33:30 +0100] "GET /images/fault.jpg HTTP/2" 200 230215
127.0.0.1 - - [24/Jan/2016:14:33:30 +0100] "GET /images/zidane.jpg HTTP/2" 200 655296
127.0.0.1 - - [24/Jan/2016:14:33:30 +0100] "GET /images/cr7.jpg HTTP/2" 200 312883

Solution

  • It seems to me, from the mod_h2 source code, that the pushed resources are handled the same way a frontend HTTP/2 request is handled -- being sent through the server in a synthesized http/1.1 request.

    That's why it gets logged as if it came in from the client.

    AFAICT, there is currently no way to differentiate these in the log.