Re: [whatwg/fetch] How are reloads mapped to cache modes? (#524)

Thanks for quick survey, mnot!

How did you test hard reload on Chrome? I think it should set no-cache even for HTML.

If we consider to have a per-fetch-group thing, it would not be an exact cache mode, but something like window.performance.navigation.type? But navigation type to cache mode mapping would not be easy and is different on each implementation today.

It is not 1:1 map, and even not just looking resource type. For instance, Chrome checks if load event is already trigger, check if URL contains query part, etc etc. But we could define a basic rule of per-fetch-group navigation type to per-fetch cache mode, with a note that says browser may optimize cache mode to meet browser specific strategy.

So my rough proposals are

1. define per-fetch-group navigation type
2. add "auto" cache mode that counts per-fetch-group in to decide preferable per-fetch cache mode automatically
3. define basic rule of navigation type to cache mode map that browser would follow on converting "auto" to effective cache mode
4. swap "reload" and "no-cache" of cache mode

1 and 2 could be optional.

The map of 3 would be

| navigation type | cache mode |
| --- | --- |
| navigate | default |
| reload | reload |
| hard reload | no-cache |
| back forward (GET) | force-cache |
| back forward (POST) | only-if-cached |

But, we could omit hard reload entry because today we do not standardize hard reload at all, i.e. location.reload() does not take a boolean flag in the standard.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/524#issuecomment-293819423

Received on Thursday, 13 April 2017 07:55:45 UTC