By ephman on
i'm trying to figure out why in the html code or in my xml feeds images are being coded like imagname.jpg?randomnumber if you look at http://www.ephman.com/sites/default/files/michaelfrantispearhead_0.jpg?1... you'll notice the ?randomnumber here's the webpage, and in the code you'll notice the http://www.ephman.com/article/michael-franti-spearhead-nyc-review-termin... anyway i can remove that ?randomnumber part?
thank,
ephman
Comments
Query string ignored
The random number you are seeing is there to give the image a unique URL to get around browser caching. That is, the browser considers www.example.net/image.png?1 to be different from www.example.net/image.png?2 even though the ?1 and ?2 are meaningless and can be removed without harm.
Ordinarily, the query string (the ? and everything following) is used to pass variables to the page, e.g. www.example.com/myscript.php?user=joe sends the variable "user" with the value "joe" to myscript.php . But in this case, the URI being referenced isn't a script, it's just an image, so the string is ignored. This is a trick commonly used not only to get around image caching, but as a primitive way to track clickthroughs (e.g. www.example.org/about?fromhomepage and www.example.org/about?fromemail ).