I've come across something just recently, I'm not sure what it is, and I'm not even sure how to go about "Googling it". 

As I've been working to modify some CSS, I've come across an image, with a long number following it. For example:

url('../images/background-img.jpg?1487047946') white;

What is the number for? Attempts to Google it just get responses to "What is .JPG" or the like.

Thank you for the help.

Comments

yelvington’s picture

Query strings are useful for forcing a web browser to fetch a new version of an image (or CSS or JSS file) when necessary.

The browser will happily cache background-img.jpg and use it on multiple pageviews. What happens if background-img.jpg is changed, but retains the original filename? By appending the query string to the image reference, the webserver makes sure that the web browser considers it to be a new file, and downloads the changed  version instead of just using the cached version. 

BEGRAFX’s picture

Thank you. I learned something new. So, if I am understanding correctly, between what you said, and the superficial glance I took at a Wikipedia article on Query strings, there is no significance to the specific number; I would get the same effect if I used ?573829494 or if I used ?17 , is that correct? 

mmjvb’s picture

BEGRAFX’s picture

Thank you I'll take a look.