Mobile app version of vmapp.org
Login or Join
Margaret771

: What is the meaning of adding (?1297280570) to the image names? Sometimes i find images on the sites added through css. Even if image name is (let's say) footer_logo.gif. In css it will be

@Margaret771

Posted in: #Images

Sometimes i find images on the sites added through css. Even if image name is (let's say) footer_logo.gif. In css it will be added as footer_logo.gif?1297280570

What do I miss in here?

Regards,

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret771

3 Comments

Sorted by latest first Latest Oldest Best

 

@Michele215

Some other possible answers.

1) Imagine if you have a blog and upload a photo called photo.jpg.

Some days later a friend send you a photo called photo.jpg. When you download it to your images folder you probably will rename it photo1.jpg or a more specific name. photo_sent_by_john.jpg

If you upload that photo there is no way the blog know how to rename the photo.jpg to anithing.

So it is safer to generate a unique random name.

2) It is better to have a randon name if you have a gallery of photos that you want the people to see in context, this is reading the article.

Before cms and this random rename on upload, you could have the name of a picture of your favorite actress if you found the first gallery/photo01.jpg and started retriving images in sequence.

If the name is random you need the specific name to retrive that.

A folder also can have random names.



This 2 scenarios are used not only in css but in public sites like youtube. All thoose have random names on the generated link.

10% popularity Vote Up Vote Down


 

@Merenda852

The chances are that it's a cachebuster - used to ensure that the url is unique (typically a random number or a time stamp) and that the image is therefore forced to be reloaded. It might be used where images are generated by the server on the fly, as an alternative to using a different actual image name every time (which has knock on implications), this mechanism just ensures that the image is always reloaded.

See this page describing more info about cachebusters

I would imagine this number is almost certainly a timestamp, as it's encoding a date this year in unix time - the number of seconds since Jan 1 1970. Converting your number into a date, you get Wed Feb 09 2011 19:42:50 GMT+0000 which would be the last time that image was generated.

Of course it's not necessarily anything to do with the image or css. The question mark simply denotes that what is about to follow are some parameters passed in the url to the web server, which can be used for whatever is relevant on the website:

See stackoverflow.com/questions/574493/what-is-the-symbol-in-url-used-for-in-php

10% popularity Vote Up Vote Down


 

@Lengel450

Probably that's a cache prevention or a version number or a tracking method or someting else.

For example:

If you just place footer_logo.gif, everytime the image loads it may be stored in the cache memory of your browser (so the next times it loads it will fetch that cached version, it's faster).

If you plan to refresh it, you can add a query (in your example it's 1297280570), this way you tell the browser to refresh it (as long as it hasn't been loaded before). After that it will be cached again (it depends on the browser and webpage settings).

If it's a version number, it will work in the same way as the previous example, the "difference" is that it tells the developer which version it is using;
In this case it can also use a dynamic system to change the image, it's more complex to explain here and would probably be done in a different way.

If it were a tracking method, when the image was loaded, the server would gather that query and use it in its statistics, etc.

It can be something else...

BTW, this question could belong to stackoverflow.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme