Mobile app version of vmapp.org
Login or Join
Shelley277

: Why does a CDN strip the file extension of an image to protect against leeching So I was reading on Quora and came across this awesome picture: http://qph.is.quoracdn.net/main-qimg-fa81af575c5e0ef69d78fc011a71e865?convert_to_webp

@Shelley277

Posted in: #Cdn #FileExtension #Images

So I was reading on Quora and came across this awesome picture:
qph.is.quoracdn.net/main-qimg-fa81af575c5e0ef69d78fc011a71e865?convert_to_webp=true
Trying to isolate this resource I noticed the odd url. I want to understand what's going on there... and why I cannot a save a valid picture file of this using the "Save Image as..." option when I right-click it (I'm using Chrome). It saves a file but is "corrupted" (or so says Image Viewer) yet it was saved from a valid image rendered on my browser.

Is the CDN messing with the file extension of the picture on purpose as a way to combat saving? How is it that my browser can render it despite it being served by such a URL (with no file extension)?

Note: I am not trying to infringe on the copyrights of whomever owns this picture. I also know it's easy enough to actually "save" a valid copy of it by just doing the old Ctrl-C + Ctrl-V into a image editor. My question is specifically about the way the CDN is serving the image thru that weird URL... and the purpose behind it.

PS: trying to view the saved file (in various PCs) results in this:

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

1 Comments

Sorted by latest first Latest Oldest Best

 

@Margaret670

I just figured this out. That cdn is using a Script called convert_to_webp. I can't tell you what language it was written in. It is short for Convert to webpage, which accepts a boolean value(true or false) If covert to webp is true you must Save the Page as HTML. If you want the actual picture, go to the link you provided in your post, and change true to false.

UPDATE
Content Download Networks must pay for their bandwidth, just like the rest of us. Consider the following example:

Code for html page...
img src="http://somesite.com/somepost/someimg.jpg" alt="[someimg]" width="x" height="y"

vs.

Code for html page...
img src="mylocalimgdirectory/someimg.jpg" alt="[someimg]" width="x" height="y"

Case 1 Generates traffic on your site + the server at somesite must answer. Your page takes longer to load because somesite must reply. If somesite breaks or moves someimg somewhere else your page gets the nasty X placeholder. In the olden days of the net, this was acceptable, as somesite could answer the request sent to your ISP Faster than the modem could load it the 1st time.

Case 2 on the other hand forces the Host of the page to host his own images. This decreases load time, and increases perceived speed, because there is no intermediate request to somesite.

Now the reason the script exists is to prevent me from using Case 1 to directly link to the image. A novice web author will remove the Script by removing everything past the ? and use that as the img src but without the script the default setting is true, which renders the image as a page, which in turn breaks the link in your html page. There is also no way for me to cheat unless I change the parameter to false, which allows direct linking, but most likely the IP Address of my site will be blacklisted for causing a traffic spike on the CDN, or the CDN will contact me, and offer 2 choices.


Stop "sharing resources" or we will ban your site from using us. (Blacklisted)
Become a paying customer, and you can have access to our CDN


Some examples of this include WordPress.com vs WordPress.org, and My Hosting Provider PowerDNN vs DNN. Each paid subscriber earns the right to use special internal tools because they are paid for. In short, the CDN is preventing loss of profit due to Free Loaders. See Item 7

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme