0
我现在用的是"Index as Table"功能显示与ActiveAdmin表:行级高速缓存“指数作为表”
index :pagination_total => false do
if Ability.new(current_user).can? :manage, :metric
selectable_column
end
column '' do |metric|
links = link_to(metric.icon, admin_metric_path(metric), :title => metric.comment)
links += link_to(metric.data_icon, admin_metric_path(metric)) unless metric.datum_ids.empty?
links
end
column 'Status', :success, sortable: :success do |metric|
metric.success == 1 ? status_tag('Success', :ok) : status_tag('FAILED', :error)
end
column 'When (UTC)', :createddttm
column 'What', :metric_name
column 'Area', :logarea
column 'Subarea', :subarea
column 'Value', :value
column 'Machine', :machine_name, sortable: 'machinename.machinename'
column 'Domain', :domain_name, sortable: 'domain.domainname'
column 'Product', :product_name, sortable: 'product.productname'
column 'Version', :product_version, sortable: 'product.productversion'
column 'Install Type', :install_type, sortable: 'product.productinstalltype'
column 'Lang', :language
column 'Duration', :duration
end
鉴于该行的数据不会改变,我想补充的行级缓存呈现HTML与很长的到期时间,但我不知道如何钩入Arbre中的行渲染代码。
我目前缓存整个页面60秒,但这不是最佳。我的缓存存储是Dalli/memcached。
这不会让我一个分段的行。这只是给我的应用增加了一个更大的存储需求,尽管CachedRecords实际上只是一个Rails.cache检查。 – 2014-09-02 19:27:32
我想你缓存因为太多的sql语句... – nistvan 2014-09-02 19:32:57
我更新了我的答案。 – nistvan 2014-09-04 18:43:53