Wins Lin
2013-Jun-04 14:33 UTC
What is a "low level caching" in Rails in terms of SQL Caching?
In the Rails Guides about caching there is an explanation: However, it’s important to note that query caches are created at the start of an action and destroyed at the end of that action and thus persist only for the duration of the action. If you’d like to store query results in a more persistent fashion, you can in Rails by using low level caching. So what is that "low level caching"? Is it explained in Guides? -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6c5d5c771655ca736d6b727837ff5b25%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
mike
2013-Jun-04 15:30 UTC
Re: What is a "low level caching" in Rails in terms of SQL Caching?
On Tuesday, June 4, 2013 10:33:49 AM UTC-4, Ruby-Forum.com User wrote:> > In the Rails Guides about caching there is an explanation: > > However, it’s important to note that query caches are created at the > start of an action and destroyed at the end of that action and thus > persist only for the duration of the action. If you’d like to store > query results in a more persistent fashion, you can in Rails by using > low level caching. > > So what is that "low level caching"? Is it explained in Guides? > > -- > Posted via http://www.ruby-forum.com/.Actually, I don''t think it is. It might be and I''m just not aware of it. Rails has several layers of caching. Page, Action, and fragment caching are high level caches. There''s a general cache, Rails.cache, that exists and you can write to it directly at a lower level. Typically, this is done in a model and the mainstay of low level caching is the Rails.cache.fetch method. You can also initiate your own caches. There might be places on the web that document it. It''s pretty well documented in *The Rails 4 Way* but that''s a book you would need to purchase. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/68bc97a9-3569-43f9-a3c1-5d5c1bc86549%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
John Davalos
2013-Jun-06 15:21 UTC
Re: Re: What is a "low level caching" in Rails in terms of SQL Caching?
check this article out. http://robotmay.com/post/23161612605/everyone-should-be-using-low-level-caching?20dba200 i hope you find it useful On Tue, Jun 4, 2013 at 8:30 AM, mike <mruch-sRllvWT3TyAqDJ6do+/SaQ@public.gmane.org> wrote:> > > On Tuesday, June 4, 2013 10:33:49 AM UTC-4, Ruby-Forum.com User wrote: >> >> In the Rails Guides about caching there is an explanation: >> >> However, it’s important to note that query caches are created at the >> start of an action and destroyed at the end of that action and thus >> persist only for the duration of the action. If you’d like to store >> query results in a more persistent fashion, you can in Rails by using >> low level caching. >> >> So what is that "low level caching"? Is it explained in Guides? >> >> -- >> Posted via http://www.ruby-forum.com/. > > > Actually, I don''t think it is. It might be and I''m just not aware of it. > Rails has several layers of caching. Page, Action, and fragment caching > are high level caches. There''s a general cache, Rails.cache, that exists > and you can write to it directly at a lower level. Typically, this is done > in a model and the mainstay of low level caching is the Rails.cache.fetch > method. You can also initiate your own caches. There might be places on > the web that document it. It''s pretty well documented in *The Rails 4 Way > * but that''s a book you would need to purchase. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/68bc97a9-3569-43f9-a3c1-5d5c1bc86549%40googlegroups.com?hl=en-US > . > > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAE%2BzMv9N2T6cn2nZPBz%3DgYWh6LTSmHAyWThVB-5XPDRAFmHmCA%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.