Hi all I''m trying to make a copy of my whole Rails website using wget: wget -rkpl 5 localhost:3000 Sadly all the references to images, stylesheets, javascripts etc. don''t work, I guess because of the timestamps that are appended to every file when linked: localhost:3000/images/covers/142/ava1cd033_b.jpg?1218812815 just doesn''t work locally. How can I disable them so I can get the wget copy to work properly? Thanks a lot for help. Josh -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeremy Kemper
2008-Sep-04 05:58 UTC
Re: Disable timestamps (scaffold.css?82563531) for wget?
On Thu, Sep 4, 2008 at 12:56 AM, Joshua Muheim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all > > I''m trying to make a copy of my whole Rails website using wget: > > wget -rkpl 5 localhost:3000 > > Sadly all the references to images, stylesheets, javascripts etc. don''t > work, I guess because of the timestamps that are appended to every file > when linked: > > localhost:3000/images/covers/142/ava1cd033_b.jpg?1218812815 > > just doesn''t work locally. How can I disable them so I can get the wget > copy to work properly?Set ENV[''RAILS_ASSET_ID''] = '''' in your environment to disable them by setting the asset id to an empty string. Best, jeremy --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joshua Muheim
2008-Sep-04 10:09 UTC
Re: Disable timestamps (scaffold.css?82563531) for wget?
Jeremy Kemper wrote:> On Thu, Sep 4, 2008 at 12:56 AM, Joshua Muheim > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> localhost:3000/images/covers/142/ava1cd033_b.jpg?1218812815 >> >> just doesn''t work locally. How can I disable them so I can get the wget >> copy to work properly? > > Set ENV[''RAILS_ASSET_ID''] = '''' in your environment to disable them by > setting the asset id to an empty string. > > Best, > jeremyThanks, this works a lot better so far. Can you give me a link that describes what this Env var really does (what'' the theory behind it?), please? Couldn''t really find a good on myself. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2008-Sep-04 10:32 UTC
Re: Disable timestamps (scaffold.css?82563531) for wget?
On 04 Sep 2008, at 12:09, Joshua Muheim wrote:>>> localhost:3000/images/covers/142/ava1cd033_b.jpg?1218812815 >>> >>> just doesn''t work locally. How can I disable them so I can get the >>> wget >>> copy to work properly? >> >> Set ENV[''RAILS_ASSET_ID''] = '''' in your environment to disable them by >> setting the asset id to an empty string. >> >> Best, >> jeremy > > Thanks, this works a lot better so far. Can you give me a link that > describes what this Env var really does (what'' the theory behind it?), > please? Couldn''t really find a good on myself.Browsers cache images/javascript/stylesheet files. If the url is exactly the same, the browser will use the cached version. Suppose you have localhost:3000/images/covers/142/ava1cd033_b.jpg and decide to update that ava1cd033_b.jpg, there''s a big chance you won''t see the actual update until you either refresh the whole page (and I mean a real manual refresh) or even clear the browser''s cache. By adding the asset string (which is just a timestamp of the modification datetime of the file), the url will change if the file is updated, but stay the same if the file hasn''t been updated. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joshua Muheim
2008-Sep-04 10:36 UTC
Re: Disable timestamps (scaffold.css?82563531) for wget?
Peter De Berdt wrote:> Suppose you have localhost:3000/images/covers/142/ava1cd033_b.jpg and > decide to update that ava1cd033_b.jpg, there''s a big chance you won''t > see the actual update until you either refresh the whole page (and I > mean a real manual refresh) or even clear the browser''s cache. By > adding the asset string (which is just a timestamp of the modification > datetime of the file), the url will change if the file is updated, but > stay the same if the file hasn''t been updated.Sounds reasonable! :-) Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---