Using Absolute Versus Relative Paths for Images

后端 未结 3 1518
感情败类
感情败类 2021-01-05 12:59

A coworker just asked me if there were any reason why referring to images with a relative path would impede site speed.

While for cleanliness it\'s a good idea to h

3条回答
  •  时光说笑
    2021-01-05 13:33

    A remote absolute path will go thru DNS but it frees up your web server to serve pages while another server gets the work of serving images. That lightens the network load on the page server and speeds things up.

    A local absolute path will be the same as local relative in that after the first page it, it will be cached by the web server and it's not going to matter after that.

提交回复
热议问题