{"action":"created","issue":{"url":"https://api.github.com/repos/h2o/h2o/issues/521","labels_url":"https://api.github.com/repos/h2o/h2o/issues/521/labels{/name}","comments_url":"https://api.github.com/repos/h2o/h2o/issues/521/comments","events_url":"https://api.github.com/repos/h2o/h2o/issues/521/events","html_url":"https://github.com/h2o/h2o/issues/521","id":107844535,"number":521,"title":"Server push times","user":{"login":"valour01","id":5527468,"avatar_url":"https://avatars.githubusercontent.com/u/5527468?v=3","gravatar_id":"","url":"https://api.github.com/users/valour01","html_url":"https://github.com/valour01","followers_url":"https://api.github.com/users/valour01/followers","following_url":"https://api.github.com/users/valour01/following{/other_user}","gists_url":"https://api.github.com/users/valour01/gists{/gist_id}","starred_url":"https://api.github.com/users/valour01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valour01/subscriptions","organizations_url":"https://api.github.com/users/valour01/orgs","repos_url":"https://api.github.com/users/valour01/repos","events_url":"https://api.github.com/users/valour01/events{/privacy}","received_events_url":"https://api.github.com/users/valour01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-23T03:48:53Z","updated_at":"2015-09-23T12:21:47Z","closed_at":null,"body":"Hi.\r\nI tried the server push of h2o. An interesting thing is that even if my index.html contains 5 png with the same src. And I set the server to push this. I can only get the push_promise once. Do you know why? And could you please locate the related code for me. Thanks a lot"},"comment":{"url":"https://api.github.com/repos/h2o/h2o/issues/comments/142583132","html_url":"https://github.com/h2o/h2o/issues/521#issuecomment-142583132","issue_url":"https://api.github.com/repos/h2o/h2o/issues/521","id":142583132,"user":{"login":"valour01","id":5527468,"avatar_url":"https://avatars.githubusercontent.com/u/5527468?v=3","gravatar_id":"","url":"https://api.github.com/users/valour01","html_url":"https://github.com/valour01","followers_url":"https://api.github.com/users/valour01/followers","following_url":"https://api.github.com/users/valour01/following{/other_user}","gists_url":"https://api.github.com/users/valour01/gists{/gist_id}","starred_url":"https://api.github.com/users/valour01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valour01/subscriptions","organizations_url":"https://api.github.com/users/valour01/orgs","repos_url":"https://api.github.com/users/valour01/repos","events_url":"https://api.github.com/users/valour01/events{/privacy}","received_events_url":"https://api.github.com/users/valour01/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T12:21:47Z","updated_at":"2015-09-23T12:21:47Z","body":"Okay. Here is my h2o configure:\r\n\r\n    listen: 8080\r\n    listen:\r\n      port: 8081\r\n      ssl:\r\n        certificate-file: /usr/local/etc/h2o/server.crt\r\n        key-file: /usr/local/etc/h2o/server.key\r\n    hosts:\r\n      \"alternate.127.0.0.1.xip.io:8081\":\r\n        listen:\r\n          port: 8081\r\n          ssl:\r\n            certificate-file: /usr/local/etc/h2o/alternate.crt\r\n            key-file: /usr/local/etc/h2o/alternate.key\r\n        paths:\r\n          /:\r\n            mruby.handler: |\r\n              Proc.new do |env|\r\n                push_paths = []\r\n                if env[\"PATH_INFO\"] == \"/\"\r\n                  push_paths << \"img/res/main-text.png\"\r\n                  push_paths << \"img/res/peng.mp3\"\r\n                end\r\n                [399, push_paths.empty? ? {} : {\"link\" => push_paths.map{|p| \"<#{p}>; rel=preload\"}.join(\"\\n\")}, []]\r\n              end\r\n            file.dir: /var/www/test\r\n        access-log: /var/log/h2o/access.log\r\n\r\n\r\nAnd my file structure is here:\r\n\r\n    *  css\r\n        *  .....css\r\n    *  js\r\n        *  .....js\r\n    *  index.html\r\n    *  img\r\n        *  ....img\r\n\r\nAnd in my index.html ,I have 5 imgs with the same src\r\n\r\n    <img  src=\"img/res/main-text.png\">\r\n    <img  src=\"img/res/main-text.png\">\r\n    <img  src=\"img/res/main-text.png\">\r\n    <img  src=\"img/res/main-text.png\">\r\n    <img  src=\"img/res/main-text.png\">\r\n\r\nThen I made a request to  https://127.0.0.1:8081/ . According to the chrome://net-internals/ , I got such information related to main-text.png(I just propose those frames related to main-text.png). You can seen I can got get one push_promise and the client will still send the request headers\r\n\r\n    t=   19 [st=    2]    HTTP2_SESSION_RECV_PUSH_PROMISE\r\n                          --> :authority: 127.0.0.1:8081\r\n                              :method: GET\r\n                              :path: /img/res/main-text.png\r\n                              :scheme: https\r\n                              accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n                              accept-encoding: gzip, deflate, sdch\r\n                              accept-language: zh-CN,zh;q=0.8,en;q=0.6\r\n                              user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36\r\n                          --> id = 1\r\n                          --> promised_stream_id = 2\r\n    t=   19 [st=    2]    HTTP2_SESSION_RECV_HEADERS\r\n                          --> fin = false\r\n                          --> :status: 200\r\n                              accept-ranges: bytes\r\n                              content-length: 37217\r\n                              content-type: image/png\r\n                              date: Wed, 23 Sep 2015 12:15:45 GMT\r\n                              etag: \"55e7ef8f-9161\"\r\n                              last-modified: Thu, 03 Sep 2015 06:58:23 GMT\r\n                              server: h2o/1.5.0-beta3\r\n                              x-http2-push: pushed\r\n                          --> stream_id = 2    \r\n\r\n    t=  331 [st=  314]    HTTP2_STREAM_ADOPTED_PUSH_STREAM\r\n                          --> stream_id = 2\r\n                          --> url = \"https://127.0.0.1:8081/img/res/main-text.png\"    \r\n\r\n    t=  335 [st=  318]    HTTP2_SESSION_SEND_HEADERS\r\n                          --> fin = true\r\n                          --> :authority: 127.0.0.1:8081\r\n                              :method: GET\r\n                              :path: /img/res/main-text.png\r\n                              :scheme: https\r\n                              accept: image/webp,image/*,*/*;q=0.8\r\n                              accept-encoding: gzip, deflate, sdch\r\n                              accept-language: zh-CN,zh;q=0.8,en;q=0.6\r\n                              referer: https://127.0.0.1:8081/\r\n                              user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36\r\n                          --> priority = 4\r\n                          --> stream_id = 23\r\n                          --> unidirectional = false"}}