Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: sideshowbarker <[email protected]>
  • Loading branch information
wbamberg and sideshowbarker authored Jul 2, 2024
1 parent 0f79e72 commit 8563c90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions files/en-us/web/api/requestinit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can also construct a `Request` with a `RequestInit`, and pass the `Request`

- `default`

- : The browser looks for a matching request in its HTTP cache.
- : The browser looks in its HTTP cache for a response matching the request.

- If there is a match and it is [fresh](/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age), it will be returned from the cache.
- If there is a match but it is [stale](/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age), the browser will make a [conditional request](/en-US/docs/Web/HTTP/Conditional_requests) to the remote server. If the server indicates that the resource has not changed, it will be returned from the cache. Otherwise the resource will be downloaded from the server and the cache will be updated.
Expand All @@ -66,24 +66,24 @@ You can also construct a `Request` with a `RequestInit`, and pass the `Request`
- : The browser fetches the resource from the remote server without first looking in the cache, _but then will_ update the cache with the downloaded resource.
- `no-cache`

- : The browser looks for a matching request in its HTTP cache.
- : The browser looks in its HTTP cache for a response matching the request.

- If there is a match, _fresh or stale,_ the browser will make a [conditional request](/en-US/docs/Web/HTTP/Conditional_requests) to the remote server. If the server indicates that the resource has not changed, it will be returned from the cache. Otherwise the resource will be downloaded from the server and the cache will be updated.
- If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource.

- `force-cache`

- : The browser looks for a matching request in its HTTP cache.
- : The browser looks in its HTTP cache for a response matching the request.

- If there is a match, _fresh or stale_, it will be returned from the cache.
- If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource.

- `only-if-cached`

- : The browser looks for a matching request in its HTTP cache. {{experimental_inline}}
- : The browser looks in its HTTP cache for a response matching the request. {{experimental_inline}}

- If there is a match, _fresh or stale_, it will be returned from the cache.
- If there is no match, the browser will respond with a [504 Gateway timeout](/en-US/docs/Web/HTTP/Status/504) status.
- If there is no match, a network error is returned.

The `"only-if-cached"` mode can only be used if the request's [`mode`](/en-US/docs/Web/API/Request/mode) is `"same-origin"`. Cached redirects will be followed if the request's `redirect` property is `"follow"` and the redirects do not violate the `"same-origin"` mode.

Expand Down

0 comments on commit 8563c90

Please sign in to comment.