Refresh meta tag not working properly
The meta refresh after a certain time was introduced by introduced. This is supported by all major browsers. This is similar to HTTP refresh header. Following is an example refresh meta tag:
<meta http-equiv="refresh" content="600;url=/?r=refresh">
Following is an example HTTP refresh header:
HTTP/1.1 200 OK Refresh: 0; url=/?r=refresh Content-Type: text/html Content-Length: 108
The issue
We were facing an issue with the refresh meta tag. We were setting the content attribute with proper time (in seconds). But it was not adding the refresh query string with the current URL. Our provided url attribute setting was wrong. Following is the wrong way of setting URL in refresh meta tag
<meta http-equiv="refresh" content="600;" url="/?r=refresh"> <!--(wrong)-->
The Solution
The url attribute should be inside the content attribute of the meta tag. As soon as we moved the url inside the content attribute it starts working. Following is the corrected refresh meta tag:
<meta http-equiv="refresh" content="600;url=/?r=refresh">