|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
I was told long ago that relative paths were better to use in web site development (e.g. in HREFs) because absolute paths use additional Apache hits on the server, and therefore additional load.
I have been trying to find out if this load issue is true, after noticing that they seem to cause Apache hits in the logs either way. From what I could find out, absolute paths do mean that Apache has to resolve the domain every time it hits one of the absolute paths - so my question is, would there be any significant increased load from absolute paths in HREFs, IMG tags etc, or is here some form of caching involved perhaps that negates the problem. Thanks for your input ![]() |
|
#2
|
||||
|
||||
|
AFAIK, fully qualified (i.e. http://domain.com/images/foo.png), absolute (i.e. /images/foo.png), and related (i.e. images/foo.png or ../images/foo.png) all look the same to your server. A request for a single webpage then spawns numerous requests for all of its images, javascripts, stylesheets, etc, and you will see all of these in your access logs.
The real difference is between HTTP 1.0 and HTTP 1.1. My understanding is that 1.0 opens a separate connection per request, thereby spawning Apache processes for each request, and that 1.1 sends all of its requests across a single connection, thus using fewer children. Domain resolution is a requirement of the browser, and the server shouldn't need to do this once the request reaches it. The exception would be if you have reverse lookups on to turn the IP in to a domain name in your logs, which is not recommended and I believe it to be rather rare.
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > general - Absolute vs Relative Paths and Server Load |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|