Hi,
Which one is loaded faster? Shall I store an image in my hosting an display it or outsource it from different website and display it in my website?
<img src="in my image folder/image.jpg" />
OR
<img src="" />
Thanks
Hi,
Which one is loaded faster? Shall I store an image in my hosting an display it or outsource it from different website and display it in my website?
<img src="in my image folder/image.jpg" />
OR
<img src="" />
Thanks
Short answer: host images where you control availability, headers and protocol — either on your server or on a reputable CDN. Outsourcing to an arbitrary third party risks broken or changed images, hotlink blocking, privacy/trackers, and mixed-content problems on HTTPS sites. called out reliability; that is the core practical risk.
Performance notes: modern browsers and servers using HTTP/2 or HTTP/3 multiplex many requests over a single connection, so the old domain-sharding trick that split assets across domains is usually unnecessary and can make things worse. was right that subdomains used to increase parallel connections under HTTP/1.1, but test for your stack. Using a CDN or edge network often gives the best latency and cache-hit behavior; relative vs absolute URLs to the same origin have negligible speed difference once DNS and connection setup are done.
Operational and security points: if you host images yourself or via CDN you can set Cache-Control, version filenames for cache busting, serve over HTTPS to avoid mixed-content blocking, and serve from a cookieless origin to reduce request headers. Hotlinked images are outside your control: cache headers, removal, or on-the-fly replacements (ads/warnings) are possible. Cross-origin policies and CORS rarely affect simple <img> use, but mixed-protocol blocking does. See HTTP/2 guidance and caching/mixed-content basics for details.
Practical checklist:
<img src="https://cdn.example.com/photo.jpg" alt="..." loading="lazy" width="600" height="400" /> Further reading: HTTP/2 overview () and caching/mixed-content details (MDN Caching, MDN Mixed Content).
Jump to Post— laura_ci 0Hi Veledrom,
I'm not too sure about the speed implications of outsourcing an image, if I'm to be honest. But there are other factors to take into consideration here when deciding whether or not to outsource your site's imagery.
For instance, if the site containing the image has …
Hi Veledrom,
I'm not too sure about the speed implications of outsourcing an image, if I'm to be honest. But there are other factors to take into consideration here when deciding whether or not to outsource your site's imagery.
For instance, if the site containing the image has shocking server stability and connection, then no matter how good your hosting, that image won't appear on your site, which in turn makes you look bad.
And of course there's making sure the host site doesn't move, rename or delete that image. Or that the site itself doesn't disappear.
Just a few thoughts and the reasons why I prefer to keep a hold of the images I'm using.
Hope this helps
=D
The first is local, which is on your PC, and the second is the another site or absolute address of your site. I don't think the speed depend on the file location which are from the same location. '' or 'images/image.jpg ', I think they are the same, because of the same root on my PC. Maybe slow if the file is on different location. Thanks for the question. need to ask like that. Sometimes, we forget the main focus.
outsourcing the image is one way of increasing connection numbers
the http protocol limits the number of connections (2) to each domain,
exactly how i dont know, but it can be finessed
images on a subdomain pics.mysite.com
scripts on a different subdomain
text/php/html files on www.mydomain.com
the http parser can then make 2 connections to each subdomain, a total of 6(http max) and pages download faster without offsite hosting of the images
--edit--
found a link
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.