In Rails, when serving static files, you get an asset ID
that's appended to the URL, e.g.,
<script src="/javascripts/application.js?1300371955" ...
<link href="/stylesheets/custom.css?1299690788" ...
This way, the URL of a static file is changed if the file’s timestamp is changed and browsers automatically request the new file.
I saw that by using the helper methods for including static assets --- stylesheet_link_tag
, javascript_include_tag
and image_tag
--- Rails automatically adds timestamps to all references to those files.
How can I implement something similar for other assets that don't have such helper methods
e.g., .swf
files?
(Does this "strategy" to force the re-download have a name; if so, what is it called?)