Great Western Coffee Shop

Sideshoots - associated subjects => News, Help and Assistance => Topic started by: grahame on May 09, 2023, 13:44:04



Title: Hotlinking to images
Post by: grahame on May 09, 2023, 13:44:04
Many of us posters link in to images held on other servers (our hosting on the Coffee Shop being very limited to attachments).  I (personally) have problems seeing one particular poster's images. There have been two or three other reports too but I don't thinks it's all that common.  This is a poll to help me establish the facts.

1. If you have not seen the problem, please vote "no".

2. If you HAVE seen the problem, please vote "yes" AND follow up with either a description of when you saw it (a link to the post that's giving you trouble) and whether it's on all your browsers / devices, or just some ("I can see it on my phone but not on my iPad" for example).

Serving images takes substantial resource on the hosting servers.  They are designed to hotlink, but  I believe that at times they'll blacklist certain requests because they feel they might be robots, or taking too many pictures.  This could be by IP address or address range, by individual host, by who uploaded the picture / who's account it is, by the browser string, by the referring URL, or perhaps by intermediary caches such as Squid and Varnish.   Clues from your stories will help me diagnose this and advise better when it crops up - a tough one to find because the issue is inconsistent and rare, and it's not in a transaction that's taking place on our server.


Title: Re: Hotlinking to images
Post by: ellendune on May 09, 2023, 15:18:26
Possibly the post was this:

http://www.firstgreatwestern.info/coffeeshop/index.php?topic=27351.msg333784#msg333784


Title: Re: Hotlinking to images
Post by: grahame on May 17, 2023, 14:18:07
Thank you for your inputs folks, and for the technical details some of you have forwarded.

Here is an example of the internal request made by a browser to include an image.  This example is from a link to the image at http://www.wellho.net/pix/ranpic.jpg

Request to the server once connected:
GET /pix/ranpic.jpg HTTP/1.1

Referer information included with the request:
http://www.firstgreatwestern.info/

Browser description string included with the request:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15

Servers which allow hot linking have - as described earlier - software checks on them to see if they consider the requests genuine ones rather than churning out loads of responses to automata, and my conclusion is that some combinations of the referer and the browser (and perhaps the IP you're browsing from) are rejected.

I'm pretty sure that the referer is one of the key elements, as cutting and pasting the image URL into your browser's URL bar has - for all reports - made the image visible.

I'm also pretty sure that the browser string is key, since I have reports that the images are not visible from some browsers / devices but not others, even when the Coffee Shop is accessed in different ways from the same IP.

Solution - in "immediate mode", those of you who have the issue learn to live with it.  I have ruled out going general image hosting on our servers (mainly because of the extra management software and support needs). If we move from http to https, it may provide a solution. And we could conceivable come up with a list of hot links servers that work for everyone.  Longer term, a piece of clever coding could perhaps automatically mirror images, but all sorts of copyright issues there that I would need to think through.



This page is printed from the "Coffee Shop" forum at http://gwr.passenger.chat which is provided by a customer of Great Western Railway. Views expressed are those of the individual posters concerned. Visit www.gwr.com for the official Great Western Railway website. Please contact the administrators of this site if you feel that content provided contravenes our posting rules ( see http://railcustomer.info/1761 ). The forum is hosted by Well House Consultants - http://www.wellho.net