I have seen on various sites a querystring followed by a numbers for images and css files. When I look at the source code (via Chrome Developer), the cached css files and images do not have the number in the query string in their names. I have also seen on sites where the number changes in the querystrings when I refresh the page.
As example:
myimage.jpg?num=12345
myStyles.css?num=82943
After refresh:
myimage.jpg?num=67948
myStyles.css?num=62972
Can anyone explain to me what could possibly be the purpose of these querystrings short of tracking?
Often times developers use those query strings with random numbers (or version numbers) to force the browser to request a fresh copy and avoid caching of those files since the request is different each time.
So if you have a file /image.png
but it is a generated image, like perhaps a captcha or something, you could follow it with a random number querystring /image.png?399532
which the browser would then not pull image.png
from its cache, but instead will download a fresh copy from the server.
The query string is for version controling it force to the navigator to reload the css and the image instead of use the cache