使用框架可以很容易地列出完整的URL,以便我的html src和href属性,并且我觉得我通过列出完整的url而不是相对路径。但这是否更快?我是否会招致额外的DNS查询?当内容位于同一台服务器上时,最佳做法是什么?html src和href属性的相对路径或url
<img src='http://site.com/images/img1.png' />
VS
<img src='/images/img1.png' />
笨的形象帮助IMG()就像this from the users' guide:
echo img('images/picture.jpg');
// gives <img src="http://site.com/images/picture.jpg" />
和CodeIgniter的锚帮手锚()就像this from the users guide:
echo anchor('news/local/123','My News');
// gives <a href="http://example.com/index.php/news/local/123" >My News</a>
我在远程服务器上开发,所以http查找总是有效的。我在每次保存时将本地ide与远程服务器同步,并且只在远程服务器上运行代码。 “http://mysite.com/”部分由我的框架中的一个方法生成,所以如果我切换域,很容易改变。没有人回答我关于DNS查询速度的问题,这是我的要求。 – steampowered
我编辑了我的问题,包括codigniter的东西,也标记codeigniter – steampowered