• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "absolute vs relative urls"

Collapse

  • NickFitz
    replied
    Originally posted by scotspine View Post
    the reason for asking was that iirc the browser reconstructs the absolute url, if it has been given a relative url, before submitting the request to the server but i'm not sure that i recall that correctly.
    It has to to determine which server to submit the request to. Remember, it's all just HTTP. In fact, it has to decompose the absolute URL as well, as it has to make a socket connection to the host, then request the absolute path and, for HTTP 1.1, include the Host header:

    Code:
    GET /foo/bar/tubgirl.jpg HTTP/1.1
    Host: www.example.com

    Leave a comment:


  • VectraMan
    replied
    Originally posted by scotspine View Post
    the reason for asking was that iirc the browser reconstructs the absolute url.
    You make it sound like that'd be complicated. It's a simple string operation. The client machine could probably do it several million times over in the time it takes the server to respond.

    Leave a comment:


  • scotspine
    replied
    the reason for asking was that iirc the browser reconstructs the absolute url, if it has been given a relative url, before submitting the request to the server but i'm not sure that i recall that correctly.

    Leave a comment:


  • NickFitz
    replied
    It depends what you mean by "performance". As Zippy says, you'll save a few bytes going over the wire. The browser isn't going to slow to a crawl when you click on either of them. Search engines aren't going to bother about the difference. JavaScript performance is unlikely to be affected for any scenario I can think of. If you are building static pages and then want to move them to a subdomain or a different domain altogether you'll have a bit of search-and-replace work to do.

    Leave a comment:


  • Zippy
    replied
    Originally posted by scotspine View Post
    i remember reading about this some time ago but neither memory nor google seem able to regurgitate.

    is there any difference in performance between specifying urls absolutely

    (eg http://www.bbc.co.uk/mynews/news.php)

    and specifying them relatively

    (eg news.php)

    when creating the link within the same directory as the target file?
    I always thought that relative urls were more efficient but my googling suggests not? Smaller file sizes, less bandwith is all I could come up with so far I'm afraid.

    Leave a comment:


  • scotspine
    started a topic absolute vs relative urls

    absolute vs relative urls

    i remember reading about this some time ago but neither memory nor google seem able to regurgitate.

    is there any difference in performance between specifying urls absolutely

    (eg http://www.bbc.co.uk/mynews/news.php)

    and specifying them relatively

    (eg news.php)

    when creating the link within the same directory as the target file?
Working...
X