MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - speeding up redirect

WebPagetest Forums

Full Version: speeding up redirect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
if I got it right, a redirect can contain a message body. Would it make sense to include some <script src="a.js"> tags in the response body, if I know that the script will be loaded by the redirect target page?

If a browser would parse the body and maybe even read the message body and fetch the java script file (assumed cacheable by the browser), the browser may have the script already, before it can parse the redirect target and find there, that a.js have to be read from the server.

Are there any good, best practices to speed up redirects (beside getting rid of redirects)?

kind regards,

I'm fairly certain that browsers will not execute anything that you send in the body of a 301/302 response. They will see the location directive and start fetching the new page right away.

The only things I'm aware of for speeding up redirects:

- make them cacheable (301 instead of 302)
- if you are redirecting across domains, ->, if is a cname to then the DNS lookup for the new domain should be a lot faster
Reference URL's