Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. Headers
  5. Refresh

Refresh header

The HTTPRefreshresponse 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="..."> in HTML.

Note:Even though it's present in the HTTP response, theRefresh header is still handled by the HTML loading machinery and happens after HTTP or JavaScript redirects. Seeredirection order of precedence for more information.

Note:When a refresh redirects to a new page, theReferer header is included in the request for the new page (if permitted by theReferrer-Policy), anddocument.referrer is set to the referrer URL after navigating.

Header typeResponse header

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

If present, the browser will redirect to the specified URL instead of refreshing with the current URL. This URL can be quoted or unquoted. Theurl= prefix is case-insensitive and optional.

Examples

Refreshing a page after a specific time

This header will cause the browser to refresh the page 5 seconds after it is fully loaded (that is, after theload event):

http
Refresh: 5

Redirecting after a specific time

This header will cause the browser to redirect to the a URL 5 seconds after the page is fully loaded:

http
Refresh: 5; url=https://example.com/

Note:See thehttp-equiv="refresh" attribute in the HTML reference for important information about accessibility implications of automatic redirects.

Specifications

Specification
HTML
# the-refresh-header

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp