Is there any additional overhead in absolute URLs to include?

I have a situation where it is easiest to move away from using relatively absolute paths for included files like CSS and Javascript. In total, there are about 10 included files per page - almost the same 10 on most pages.

I'm wondering if there will be any significant overhead (or even disadvantage other than portability) with this? This is a LAMP setup on a dedicated server where everything runs on https.

EDIT: To clarify, I mean going from "../foo.css" to " https://bar.com/foo.css ".

0


a source to share


2 answers


The only additional overhead is that they will be slightly larger (hence the page containing them is much larger). Unless you have a lot of URLs on the page, this difference should be minor.



That said, if you have any doubts about performance, it's best to measure it.

+6


a source


I don't think changing paths from relative to absolute will have a big performance impact.

My suggestion was to try and merge your CSS files together, into one CSS document and also for JS files.

This way, your site's performance will be optimized as you will only make 2 HTTP requests to the server (for CSS and JS files, images and other elements that are on the page are not included) (one for the CSS file and one for the JS file) unlike the 10 you are doing now.



I can only think that the performance of the individual user maintaining the site will be difficult: maintaining absolute urls is a pain compared to relative urls

I just found this resource and it seems that they didn't see the performance impact of the two types of urls: http://good.ly/wj3cfe

+1


a source







All Articles