- From: Ilya Grigorik <notifications@github.com>
- Date: Mon, 13 Apr 2015 12:09:18 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
Received on Monday, 13 April 2015 19:09:44 UTC
Sure, let's make it concrete. The developer provides the destination context via "as" attribute, e.g..
```js
fetch('/gallery/photo.jpg', {as: 'image'}).then(...)
```
or
```html
<link rel=preload href=/gallery/photo.jpg as=image>
```
The user agent needs to...
1. Enforce CSP based on specified context? /cc @mikewest
2. Set appropriate HTTP request headers based on context - e.g. Accept, etc.
3. Set appropriate request priority: for HTTP/1.x this is for internal prioritization; for HTTP/2 this prioritization information is communicated to the server.
I know that in Blink we advertise different headers, and assign different priorities, based on type of resource being fetched. AFAIK, same applies to FF, WebKit, and IE. 
@pmeenan @mcmanus @toddreifsteck any thoughts or comments on this one?
---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/43#issuecomment-92464936
Received on Monday, 13 April 2015 19:09:44 UTC