Need Code to Link Image from another site to mine (without needing to upload it)

Aussi_Gypsy

Registered Member
Joined
Nov 1, 2020
Messages
57
Reaction score
51
I'm interested if there is coding to put on in a article to pull an image from another website and have it display on my site without me needing to upload it and host it myself.

Is anyone willing to share that knowledge?
 
Way easier than I thought that would be, much appreciated.

Any knowledge on how much it affects page speed by chance? I don't plan on using this method often, but some big infographics I prefer to just link like this instead of host myself.
 
the speed depend on the image size and the host server of that file
 
Way easier than I thought that would be, much appreciated.

Any knowledge on how much it affects page speed by chance? I don't plan on using this method often, but some big infographics I prefer to just link like this instead of host myself.
As long as image is small in size and not over 500 Kb - 1 Mb it should be okay. Depends what you do, Google now loves webp format, since is their invention.
 
Now that you have your answer...
I think it is important to point out that this is not really a good practice.

In the sense that the external website will be spending resources on requests not beneficial to it.
 
Adding to @finco's point.

Most web host have hot linking protection.

So images will not show on your website.
 
It worked, and it's something I plan on using sparsely. Just didn't want to deal with hosting this particular info graphic for niche site.

@TomTheCat As for the webp format, I read in past that apple products don't love that format? Is that still true? That is why I avoided it so far, but just started new site and my mind could be changed.
 
@TomTheCat As for the webp format, I read in past that apple products don't love that format? Is that still true? That is why I avoided it so far, but just started new site and my mind could be changed.
Only Safari on macOS lacks support for it. On my websites I have a code to detect the browser and devices and provide the image format / size accordingly. Sometime if webp is supported is written in headers being sent from client (browser) to server.

Code:
https://caniuse.com/webp
 
Back
Top