HighDots Forums  

Question on caching

Ruby On Rails Talk Ruby On Rails programming language mailing list


Discuss Question on caching in the Ruby On Rails Talk forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gary Burke
 
Posts: n/a

Default Question on caching - 11-04-2009 , 06:21 PM






Hi there, I have a question about caching templates. We have a need
to modify certain erb files on the filesystem from time to time, but
when modified they don't update in the Rails app until the server is
restarted - they're being cached in staging and production.

I found numerous blog entries, etc. that indicate that Rails by
default checks the file modification time of a given template/partial
before caching it and will refresh from the filesystem if it finds a
newer template. This is not currently happening.

Has this behavior been removed from Rails 2.3.2 , or how can we force
this behavior?

-Gary


--~--~---------~--~----~------------~-------~--~----~
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 (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #2  
Old   
Scott Johnson
 
Posts: n/a

Default Re: Question on caching - 11-05-2009 , 12:59 PM






Are you modifying those erb files by hand? Or in code?

If in code, you need to add the appropriate expire calls to flush the
cache. (But if you're really modifying erb files as part of your app's
normal behavior, that sounds bad and I would look for a better way.)

If by hand, why not just restart the server when they change?
Typically such modifications would be tested in development mode
first, then deployed via capistrano or some other automated fashion.
In the last step, capistrano will restart the server.


On Nov 4, 3:21 pm, Gary Burke <gfbu... (AT) gmail (DOT) com> wrote:
Quote:
Hi there, I have a question about caching templates. We have a need
to modify certain erb files on the filesystem from time to time, but
when modified they don't update in the Rails app until the server is
restarted - they're being cached in staging and production.

I found numerous blog entries, etc. that indicate that Rails by
default checks the file modification time of a given template/partial
before caching it and will refresh from the filesystem if it finds a
newer template. This is not currently happening.

Has this behavior been removed from Rails 2.3.2 , or how can we force
this behavior?

-Gary
--~--~---------~--~----~------------~-------~--~----~
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 (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #3  
Old   
Frederick Cheung
 
Posts: n/a

Default Re: Question on caching - 11-05-2009 , 01:48 PM



On Nov 4, 11:21*pm, Gary Burke <gfbu... (AT) gmail (DOT) com> wrote:

Quote:
I found numerous blog entries, etc. that indicate that Rails by *
default checks the file modification time of a given template/partial *
before caching it and will refresh from the filesystem if it finds a *
newer template. This is not currently happening.

Has this behavior been removed from Rails 2.3.2 , or how can we force *
this behavior?

Isn't that what config.action_view.cache_template_loading controls ?

Fred
Quote:
-Gary
--~--~---------~--~----~------------~-------~--~----~
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 (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.