Welcome to WebmasterWorld Guest from 3.227.233.55

Forum Moderators: phranque

Message Too Old, No Replies

Too many http image calls

absolute paths vs relative paths

     
1:34 pm on Nov 13, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 18, 2002
posts: 143
votes: 0


I began using absolute image paths in server side includes (ie. [mydomain.com...] I did this because the includes are called from different directory levels. When my traffic increased to record levels, my dedicated server started to cough, choke and die. Technical support told me it was my absolute image paths that were doing it - they were creating too many http requests. I changed all the image paths in my includes to follow the format: /images/myimage.jpg. Technical support also did some apache optimization. The server now flies and my traffic has increased even more. Tech support believes that it had more to do with changing the paths versus the optimization they did.

Can someone explain to me what the difference is? I use Dreamweaver as my html editor and it automatically creates relative image links for documents. Should I change the path on these as well to be root relative?

1:47 pm on Nov 13, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


It is the browser that resolves relative paths to canonical paths. So no matter what link format you use in your HTML, the client browser always requests objects using the "full URL" -- as it must.

It is more likely that your host added or adjusted directives in your server configuration having to do with Cache-control response headers sent with your image files, so that browsers and caching proxies in the network can now cache your images -- or cache them for longer periods of time.

You should look into what Cache-control headers are returned when requesting images from your server; The "Live HTTP Headers" add-on for Firefox and Mozilla-based browsers is quite useful for this, or you can use any one of many on-line server headers checker.

In general, images can be cached for very long periods of time, since it's unlikely that they will change -- I allow my images to be cached for weeks, and some even for months.

Jim

3:37 pm on Nov 13, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 18, 2002
posts: 143
votes: 0


Thanks for the reply Jim...

I downloaded the plugin for Firefox and called a page from my site and get a blank screen for the httpliveheaders.

I went to the site where I downloaded the extension, and can see a whole list of header information for them with the httpliveheaders tool.

When I view the source code for their page, I don't see any header information there, so I assume that this header information is somehow configured in apache?

Where do you add a cache control header for images? Can you also give some examples? The images that are clobbering my server are icons that are included in the navigation on my children's site. The icons help preschoolers (who don't know how to read yet) find what they want. They also add color and interest for kids.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members