P.A.
2010-Jun-10 14:00 UTC
javascript_include_tag and stylesheet_link_tag additional generated parameters
Hi. I just wonder why do the javascript_include_tag and stylesheet_link_tag methods generate additional parameters and add them to the paths on output? For example, I have the following view: # app/views/test.haml %html %head = stylesheet_link_tag ''styles.css'' = javascript_include_tag ''scripts.js'' ... and when I load it, I get the next HTML: <html> <head> <link href="/stylesheets/styles.css?1276104169" media="screen" rel="stylesheet" type="text/css" /> <script src="/javascripts/prototype.js?1275579095" type="text/ javascript"></script> ... What do ''1276104169'' and ''1275579095'' mean and why are they added to the paths? Any help and links are wellcome. Thanks. Debian GNU/Linux 5.0.4; Ruby 1.9.2; Rails 2.3.8. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Jun-10 15:09 UTC
Re: javascript_include_tag and stylesheet_link_tag additional generated parameters
On Jun 10, 3:00 pm, "P.A." <shama...-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> > <html> > <head> > <link href="/stylesheets/styles.css?1276104169" media="screen" > rel="stylesheet" type="text/css" /> > <script src="/javascripts/prototype.js?1275579095" type="text/ > javascript"></script> > ... > > What do ''1276104169'' and ''1275579095'' mean and why are they added to > the paths?They''re the timestamps of when the file was changed. If you do update the css/javascript files then when you next rollout the timestamp will be different and people''s browsers won''t cache the old version Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rem Zolotykh
2010-Jun-10 23:01 UTC
Re: javascript_include_tag and stylesheet_link_tag additional generated parameters
And if you want to get rid of them for some reason just create new initializer with following code: ENV[''RAILS_ASSET_ID''] = '''' and restart your server. All this numbers will go away. On Jun 11, 2010, at 1:00 AM, P.A. wrote:> Hi. > > I just wonder why do the javascript_include_tag and > stylesheet_link_tag methods generate additional parameters and add > them to the paths on output? > > For example, I have the following view: > > # app/views/test.haml > > %html > %head > = stylesheet_link_tag ''styles.css'' > = javascript_include_tag ''scripts.js'' > ... > > and when I load it, I get the next HTML: > > <html> > <head> > <link href="/stylesheets/styles.css?1276104169" media="screen" > rel="stylesheet" type="text/css" /> > <script src="/javascripts/prototype.js?1275579095" type="text/ > javascript"></script> > ... > > What do ''1276104169'' and ''1275579095'' mean and why are they added to > the paths? > > Any help and links are wellcome. > > Thanks. > > Debian GNU/Linux 5.0.4; > Ruby 1.9.2; > Rails 2.3.8. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.