The Performance Impact of META REFRESH

Some sites will utilize the META REFRESH directive to perform a client-side redirection. In general, this should be avoided in favor of other redirection types, for instance, a server-side redirection (HTTP/3xx) or by using JavaScript. Using META REFRESH creates a potential performance problem in IE because IE will conditionally revalidate resources when navigating to the target URL.

For instance, when I revisit www.msn.com by typing the address into my address bar, IE issues 6 unconditional HTTP requests (to retrieve the resources which were marked as uncacheable on my prior visit). In contrast, if I use a META REFRESH to redirect to www.msn.com, like so:

<meta http-equiv="refresh" content="3;url=https://www.msn.com/" />

... IE issues 6 unconditional HTTP requests and 33 conditional HTTP requests to revalidate the page’s resources.

Interestingly, if your traffic is configured to go through a proxy, IE will also add a Pragma: no-cache header to the outbound requests generated from the META REFRESH. However, the If-Modified-Since and If-None-Match headers, if any, are not removed, so unless the proxy or server respects the Pragma directive, 304s may still be returned.

Now, one scenario where using META REFRESH may prove unavoidable is the case where you want to notify the user that your website requires JavaScript but scripting is disabled. That pattern looks like this:

<noscript>
    <meta http-equiv="refresh" content="3;url=https://example.com/ThisSiteRequiresScript.htm" />
</noscript>

Since browsing with script disabled is fairly uncommon, that scenario probably isn’t much of a problem for real-world sites.

Until next time,

-Eric