Current time: 03-07-2021, 07:58 PM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
speeding up redirect
03-23-2013, 06:24 AM
Post: #1
speeding up redirect
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,

Find all posts by this user
Quote this message in a reply
03-27-2013, 12:03 AM
Post: #2
RE: speeding up redirect
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
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 2 Guest(s)