views:

343

answers:

2

Does anyone know why there are question marks (with a number) after the images and css files (when looking at the html code)? And how can I turn them off?

+2  A: 

From Rails API documentation:

By default, Rails will append all asset paths with that asset‘s timestamp. This allows you to set a cache-expiration date for the asset far into the future, but still be able to instantly invalidate it by simply updating the file (and hence updating the timestamp, which then updates the URL as the timestamp is part of that, which in turn busts the cache).

Hope it helps.

Milan Novota
A: 

It is to be able to cache the file on the client and still making sure the client receive the newest version when there is a change. So each file modification results in a new timestamp which the client will do a new request to the server to receive the modified file.

If you do not want to use (though I cannot see why - it is a good thing) simple do not use the rails helpers for including javascripts or stylesheets. Just include the normal HTML tags: link and script.

Espen