0

Here is the example image url I found on Steam.

https://steamcommunity-a.akamaihd.net/public/shared/images/header/globalheader_logo.png?t=962016

The image url gives the same result with or without the ?t=962016. What is it called? And what does it do?

Dharman
  • 30,962
  • 25
  • 85
  • 135
vishless
  • 829
  • 1
  • 5
  • 28

2 Answers2

3

?t=962016

This is a technique to disable browser caching, browser sees it as a new url, and fetches the resource again from web server. The resource can be image, css file, js file etc. This is the most common use case, but can be also used differently by the web server.

There is another use case also. I have done this one of my project.

I have a made all requests to *.jpg handle by a php script. Eg: mysite.com/user/avatar.jpg?id=100

avatar.jpg is actually a php script which takes the query param (in this case the id 100) and returns the correspond user's avatar (user with id 100). Browser see this as an image. Another advantage is we can disable hot linking directly to this image, as the script can check if the request is originated from the same domain.

kiranvj
  • 32,342
  • 7
  • 71
  • 76
  • So I'm guessing `962016` is the version string for the image and whenever the image is changed the browser is forced to fetch from file instead of cache. – vishless Sep 10 '19 at 10:18
1

IMO there is 2 possibilities - They put that parameter to avoid the image to be cached, the value of t is random in this case - The image can be generated by a script, in this case the value of t is the id of the image.

digitalway
  • 61
  • 7