{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/resource-hints/issues/36","labels_url":"https://api.github.com/repos/w3c/resource-hints/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/w3c/resource-hints/issues/36/comments","events_url":"https://api.github.com/repos/w3c/resource-hints/issues/36/events","html_url":"https://github.com/w3c/resource-hints/issues/36","id":88908523,"number":36,"title":"prebrowsing javascript api","user":{"login":"Jxck","id":322289,"avatar_url":"https://avatars.githubusercontent.com/u/322289?v=3","gravatar_id":"","url":"https://api.github.com/users/Jxck","html_url":"https://github.com/Jxck","followers_url":"https://api.github.com/users/Jxck/followers","following_url":"https://api.github.com/users/Jxck/following{/other_user}","gists_url":"https://api.github.com/users/Jxck/gists{/gist_id}","starred_url":"https://api.github.com/users/Jxck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jxck/subscriptions","organizations_url":"https://api.github.com/users/Jxck/orgs","repos_url":"https://api.github.com/users/Jxck/repos","events_url":"https://api.github.com/users/Jxck/events{/privacy}","received_events_url":"https://api.github.com/users/Jxck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-17T04:27:09Z","updated_at":"2015-06-18T17:39:03Z","closed_at":null,"body":"like single page application, there cause lots of dynamic fetch request from javascript.\r\nbut if we need to optimize them using pre-*.\r\n\r\nwe need to scan all javascript source and apply to html as link tag,\r\nor create link element from javascript and add it to dom.\r\n\r\nI think it's helpful to export javascript API for pre-*\r\nwe don't need to care about sync with dom link tag,\r\nand complete in javascript source.\r\n\r\nfor example\r\nin case of send a request with search query and fetch result.\r\nwe can pre-connect to search server while user inputs query.\r\n\r\nlike rails turbo-links style pjax.\r\nprefetch, prerender will fit.\r\n\r\nI think someone says service worker + fetch + cache will help.\r\nbut we can't do preconnect, we don't wanna send http request.\r\nwe also can't do prerender, service worker doesn't render it.\r\nprefetch seems work, but we need to write heavy code and register to browser.\r\neasy way for enable them to browser API are welcome. "},"comment":{"url":"https://api.github.com/repos/w3c/resource-hints/issues/comments/113231544","html_url":"https://github.com/w3c/resource-hints/issues/36#issuecomment-113231544","issue_url":"https://api.github.com/repos/w3c/resource-hints/issues/36","id":113231544,"user":{"login":"annevk","id":1544111,"avatar_url":"https://avatars.githubusercontent.com/u/1544111?v=3","gravatar_id":"","url":"https://api.github.com/users/annevk","html_url":"https://github.com/annevk","followers_url":"https://api.github.com/users/annevk/followers","following_url":"https://api.github.com/users/annevk/following{/other_user}","gists_url":"https://api.github.com/users/annevk/gists{/gist_id}","starred_url":"https://api.github.com/users/annevk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annevk/subscriptions","organizations_url":"https://api.github.com/users/annevk/orgs","repos_url":"https://api.github.com/users/annevk/repos","events_url":"https://api.github.com/users/annevk/events{/privacy}","received_events_url":"https://api.github.com/users/annevk/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T17:39:03Z","updated_at":"2015-06-18T17:39:03Z","body":"Right, but service workers are short-lived... User agents analyzing what service workers typically connect to and warming those up might work. Perhaps providing some kind of `preload` dictionary when you install the service worker that you can update in some way? So that while the user agent starts running the service worker it can also start warming up connections.\r\n\r\nThere've been a number of ideas here, but I'm not sure a new API is it."}}