-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add page for HTTP Refresh header (#35709)
* Add page for HTTP Refresh header * Update files/en-us/web/http/headers/refresh/index.md Co-authored-by: Hamish Willee <hamishwillee@gmail.com> * Update files/en-us/web/http/headers/refresh/index.md * Apply suggestions from code review --------- Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
- Loading branch information
1 parent
e3676f9
commit cbbe2e8
Showing
2 changed files
with
94 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
title: Refresh | ||
slug: Web/HTTP/Headers/Refresh | ||
page-type: http-header | ||
browser-compat: http.headers.Refresh | ||
--- | ||
|
||
{{HTTPSidebar}} | ||
|
||
The **`Refresh`** response header directs a web browser to either refresh or redirect the page when a specified amount of time has passed after the page was fully loaded. It is exactly equivalent to using [`<meta http-equiv="refresh" content="...">`](/en-US/docs/Web/HTML/Element/meta#http-equiv) in HTML. | ||
|
||
> [!NOTE] | ||
> Even though it's present in the HTTP response, the `Refresh` header is still handled by the HTML loading machinery and happens after HTTP or JavaScript redirects. See [redirection order of precedence](/en-US/docs/Web/HTTP/Redirections#order_of_precedence) for more information. | ||
<table class="properties"> | ||
<tbody> | ||
<tr> | ||
<th scope="row">Header type</th> | ||
<td>{{Glossary("Response header")}}</td> | ||
</tr> | ||
<tr> | ||
<th scope="row">{{Glossary("Forbidden header name")}}</th> | ||
<td>no</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
## Syntax | ||
|
||
```http | ||
Refresh: <time> | ||
Refresh: <time>, url=<url> | ||
Refresh: <time>; url=<url> | ||
``` | ||
|
||
- `<time>` | ||
- : A non-negative number of seconds after which to refresh the page. Fractional parts are recognized but ignored; you should only specify integers. | ||
- `<url>` {{optional_inline}} | ||
- : If present, the browser will redirect to the specified URL instead of refreshing with the current URL. This URL can be quoted or unquoted. The `url=` prefix is case-insensitive and optional. | ||
|
||
## Examples | ||
|
||
This header will cause the browser to refresh the page 5 seconds after it is fully loaded (that is, after the {{domxref("Window/load_event", "load")}} event): | ||
|
||
```http | ||
Refresh: 5 | ||
``` | ||
|
||
This header will cause the browser to redirect to the homepage 5 seconds after the page is fully loaded: | ||
|
||
```http | ||
Refresh: 5; url=https://example.com/ | ||
``` | ||
|
||
See the [`http-equiv="refresh"`](/en-US/docs/Web/HTML/Element/meta#refresh) attribute in the HTML reference for important information about accessibility implications of automatic redirects. | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{htmlelement("meta")}} | ||
- [Redirections in HTTP](/en-US/docs/Web/HTTP/Redirections) |