Search code examples
imagetwitterarchitectureurl-design

Why does Twitter (twimg.com) use a suffix for size (e.g. ':large') instead of a query parameter


Why does Twitter (twimg.com) use a suffix for size (e.g. ':large') instead of a query parameter?

Example:

https://pbs.twimg.com/media/CrhajQHXgAEQ2US.jpg:large

From an architectual standpoint I find this interesting and I'm wondering if I'm missing anything.
Do they do this because certain proxies/clients don't cache urls with query parameters?

Can anyone shed some light on this?


Solution

  • I am not sure this is due to some issue with caching, but there is a semantical point. URL https://pbs.twimg.com/media/CrhajQHXgAEQ2US.jpg:large points to a certain resource. And that resource is CrhajQHXgAEQ2US.jpg:large. It is not CrhajQHXgAEQ2US.jpg as it might be in a case with a query string.