Re: Random Number Appended to Images,JS and CSS files

John Kopanas
Sun, 17 Sep 2006 01:54:43 -0000

Thanks Rimantas... I appreciate it.  Stilld does not explain why
though.  I am a big why type of guy.  Anyone know why?

On 9/16/06, Rimantas Liubertas
<rimantas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> > I am really curious... what is up with the random number being
> > appended to the query string of calls to JS, CSS and Image files?  At
> > first I thought it was just for development mode so that files would
> > not be cached but when I went to my site in production mode the random
> > number where appended as well.  Does anyone know the design decision
> > behind this?  Or if the number really is random?
> >
> > Is their a function to get that random number for when I create my own
helpers?
>
> Quote from
http://api.rubyonrails.com/files/vendor/rails/actionpack/CHANGELOG.html
> (*1.12.1* (April 6th, 2006)):
>
> Added automated timestamping to AssetTagHelper methods for
> stylesheets, javascripts, and images when Action Controller is run
> under Rails [DHH]. Example:
>
>   image_tag("rails.png") # => ''<img
alt="Rails"
> src="/images/rails.png?1143664135" />''
>
> …to avoid frequent stats (not a problem for most people), you can set
> RAILS_ASSET_ID in the ENV to avoid stats:
>
>   ENV["RAILS_ASSET_ID"] = "2345"
>   image_tag("rails.png") # => ''<img
alt="Rails" src="/images/rails.png?2345" />''
>
> This can be used by deployment managers to set the asset id by
> application revision
>
> === end of quote ==>
> Regards,
> Rimantas
> --
> http://rimantas.com/
>
> >
>


--
John Kopanas
john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com