{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/preload/issues/80","repository_url":"https://api.github.com/repos/w3c/preload","labels_url":"https://api.github.com/repos/w3c/preload/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/w3c/preload/issues/80/comments","events_url":"https://api.github.com/repos/w3c/preload/issues/80/events","html_url":"https://github.com/w3c/preload/issues/80","id":192299506,"number":80,"title":"Require \"as\" attribute","user":{"login":"AshleyScirra","id":768723,"avatar_url":"https://avatars.githubusercontent.com/u/768723?v=3","gravatar_id":"","url":"https://api.github.com/users/AshleyScirra","html_url":"https://github.com/AshleyScirra","followers_url":"https://api.github.com/users/AshleyScirra/followers","following_url":"https://api.github.com/users/AshleyScirra/following{/other_user}","gists_url":"https://api.github.com/users/AshleyScirra/gists{/gist_id}","starred_url":"https://api.github.com/users/AshleyScirra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AshleyScirra/subscriptions","organizations_url":"https://api.github.com/users/AshleyScirra/orgs","repos_url":"https://api.github.com/users/AshleyScirra/repos","events_url":"https://api.github.com/users/AshleyScirra/events{/privacy}","received_events_url":"https://api.github.com/users/AshleyScirra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-11-29T14:42:04Z","updated_at":"2016-12-16T12:06:36Z","closed_at":null,"body":"Based on discussion from this report: https://bugs.chromium.org/p/chromium/issues/detail?id=655698\r\n\r\nAllowing a normal fetch preload with an accidentally missing \"as\" attribute is a gotcha. For example if you preload a script with a missing \"as\", then later add an actual script referencing it, apparently the current specified behavior is:\r\n\r\n1. Fetch the resource over the network as per the preload directive.\r\n2. Script is added to the document: fetch the resource over the network a second time.\r\n3. Use the second copy. First copy is ignored.\r\n\r\nThis is obviously a significant deoptimisation compared to not using the preload at all!\r\n\r\nTherefore I would suggest the \"as\" attribute should be required. If the developer intends to do a fetch type preload, I suggest explicitly opting in to it with `as=\"fetch\"`, and logging an error if the \"as\" attribute is missing. This should make identifying mistakes more straightforward."},"comment":{"url":"https://api.github.com/repos/w3c/preload/issues/comments/267580789","html_url":"https://github.com/w3c/preload/issues/80#issuecomment-267580789","issue_url":"https://api.github.com/repos/w3c/preload/issues/80","id":267580789,"user":{"login":"mems","id":729275,"avatar_url":"https://avatars.githubusercontent.com/u/729275?v=3","gravatar_id":"","url":"https://api.github.com/users/mems","html_url":"https://github.com/mems","followers_url":"https://api.github.com/users/mems/followers","following_url":"https://api.github.com/users/mems/following{/other_user}","gists_url":"https://api.github.com/users/mems/gists{/gist_id}","starred_url":"https://api.github.com/users/mems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mems/subscriptions","organizations_url":"https://api.github.com/users/mems/orgs","repos_url":"https://api.github.com/users/mems/repos","events_url":"https://api.github.com/users/mems/events{/privacy}","received_events_url":"https://api.github.com/users/mems/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T12:06:36Z","updated_at":"2016-12-16T12:06:36Z","body":"@simevidas I've got a case when a webapp need to require a large JSON (or require server side heavy computations) and load it when the JS/app is ready (loaded by `fetch()` or `XMLHttpRequest`)"}}
{"actor":{"display_login":"mems"}}