3 ms·
This only works when there's only one site hosted at 10.0.0.1. When an HTTP request is made, it looks like this (not trying to be pedantic here, I'm sure you kn
by reginaldo 14y ago
This only works when there's only one site hosted at 10.0.0.1. When an HTTP request is made, it looks like this (not trying to be pedantic here, I'm sure you know how HTTP requests are made):
GET /picture.jpg HTTP/1.1
Host: host.sample.com
[Other header: value]...
Many times, the Host header is an essential part of the equation. If, for instance, you have a single IP serving as an endpoint to many different sites, you need the Host header to decide where you'll look for the resource "picture.jpg".
That could of course be solved with something like
<img src="hxxp://host.sample.com/picture.jpg" ip="10.0.0.1">
or even
<img src="hxxp://10.0.0.1/picture.jpg" host="host.sample.com">
- vardump 14y agoOr you could just "virtual host" by initial URL path, like "hxxp://10.0.0.1/host.sample.com/picture.jpg" or "hxxp://10.0.0.1/p2ezQ/picture.jpg".
- reginaldo 14y agoOf course... This is actually a much better solution than introducing a img tag attribute. It would be more visible at the template level and (at least the first example) requires minimal configuration. Out of curiosity: do you do (or know someone who does) this? Do you think the functionality is worth the code to implement it?
- vardump 14y agoNo, I don't know anyone who does this. This is just a curiosity for me. No idea if it's worth it. Measure. Build a test case that implements a limited version or emulates this somehow. Test it against some group for a few weeks or months. Did it benefit you, made no difference or harm your goals? Did it give you something unexpected that you can turn into your benefit?