That won't work because rails page caching ignore parameters. Page caching ignores all parameters. For example /products?page=1 will be written out to the filesystem as products.html with no reference to the page parameter. Thus, if someone requests /products?page=2 later, they will get the cached first page. A workaround for this limitation is to include the parameters in the page’s path, e.g. /productions/page/1.
On Fri, Mar 8, 2013 at 4:08 AM, Hernan Astudillo <[email protected]> wrote: > I know it could be obvious but just to check, rails default caching doesn't > work? > if you cache the whole rendered page (cache_page) :index, :list and :show, > and expire_page on :action => :create and :update? > http://guides.rubyonrails.org/caching_with_rails.html > > > On Thu, Mar 7, 2013 at 8:41 AM, Tim Uckun <[email protected]> wrote: >> >> I have tried my best to minimize the queries but there are still some >> queries for the belongs_to associations. For example if I have a >> table called locations and locations belong to businesses it does a >> paginated query to locations and then does an eager load of businesses >> by doing a select from business where id in (.....). This is the >> standard rails way of pulling the related records. >> >> In my case it would be more efficient to just pull all the businesses >> because there are not that many of them and cache them. From what I >> can gather there is no way to configure AS to do this. >> >> As I mentioned in the earlier emails most of my data is relatively >> static so it could be cached easily especially if there was an >> intelligent way to bust the cache when records are changed. >> >> Also as I mentioned some of the partials take a very long time to >> render so maybe those could be cached. >> >> Anyway long and short of it is that I know my data and would like to >> see if there is any way I can intelligently cache either the partials >> or the queries themselves. >> >> >> >> On Wed, Mar 6, 2013 at 11:32 PM, Sergio Cambra <[email protected]> >> wrote: >> > Check number of queries, do you have association columns? are you eager >> > loading them? if there are few associated records it's better to eager >> > load >> > them, if they are many records it's better not to eager load them, even >> > display only count and use counter_cache. Do you have some column >> > overrides? >> > Are they slow? >> > >> > El Miércoles, 6 de marzo de 2013 14:28:41 Tim Uckun escribió: >> >> Hey guys. >> >> >> >> Hate to bump my own post but any ideas about how I can make AS more >> >> performant. >> >> >> >> Thanks. >> >> >> >> On Tue, Feb 26, 2013 at 9:45 PM, Tim Uckun <[email protected]> wrote: >> >> > Hey guys. >> >> > >> >> > I have been searching through the list and there are a couple of >> >> > questions about caching but no real answers. Much (if not all) of >> >> > the >> >> > data in my admin area is cachable for a substantial amount of time >> >> > and >> >> > I am wondering how to go about doing this. Is there a guide someplace >> >> > on performance enhancements to AS. >> >> > >> >> > Along with the queries It would be really helpful if the partials >> >> > could be cached as well. Some of them take very long to render. >> >> > >> >> > Rendered >> >> > >> >> > /Users/tim/.rvm/gems/ree-1.8.7-2012.02/gems/active_scaffold-3.3.0.rc/app >> >> > /views/active_scaffold_overrides/_list_record.html.erb> >> >> > (1195.4ms) >> >> > >> >> > Rendered >> >> > >> >> > /Users/tim/.rvm/gems/ree-1.8.7-2012.02/gems/active_scaffold-3.3.0.rc/ap >> >> > p/views/active_scaffold_overrides/_list_pagination_links.html.erb> >> >> > (2.6ms) >> >> > >> >> > Rendered >> >> > >> >> > /Users/tim/.rvm/gems/ree-1.8.7-2012.02/gems/active_scaffold-3.3.0.rc/ap >> >> > p/views/active_scaffold_overrides/_list_pagination.html.erb> >> >> > (20.4ms) >> >> > >> >> > Rendered >> >> > >> >> > /Users/tim/.rvm/gems/ree-1.8.7-2012.02/gems/active_scaffold-3.3.0.rc/ap >> >> > p/views/active_scaffold_overrides/_list.html.erb> >> >> > (1602.4ms) >> >> > >> >> > Rendered >> >> > >> >> > /Users/tim/.rvm/gems/ree-1.8.7-2012.02/gems/active_scaffold-3.3.0.rc/ap >> >> > p/views/active_scaffold_overrides/_list_with_header.html.erb> >> >> > (1762.3ms) >> >> > >> >> > Rendered >> >> > >> >> > /Users/tim/.rvm/gems/ree-1.8.7-2012.02/gems/active_scaffold-3.3.0.rc/ap >> >> > p/views/active_scaffold_overrides/list.html.erb> >> >> > within layouts/admin (1776.4ms) >> >> > >> >> > >> >> > Maybe this is a 1.8.7 issue (still haven' t migrated yet) but these >> >> > seem really slow to me. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "ActiveScaffold : Ruby on Rails plugin" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an email to [email protected]. >> > To post to this group, send email to [email protected]. >> > Visit this group at http://groups.google.com/group/activescaffold?hl=en. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "ActiveScaffold : Ruby on Rails plugin" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/activescaffold?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "ActiveScaffold : Ruby on Rails plugin" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/activescaffold?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/activescaffold?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
