Essais de cache pour accélérer encore la page principale

This commit is contained in:
echarp 2014-08-16 23:19:03 +02:00
parent d18eb7aa18
commit 8901183d12
3 changed files with 22 additions and 20 deletions

View File

@ -1,3 +1,7 @@
ActiveAdmin.register Region do ActiveAdmin.register Region do
permit_params :name permit_params :name
after_update do
expire_fragment 'regions'
end
end end

View File

@ -11,7 +11,7 @@
display: none display: none
position: absolute position: absolute
list-style: none list-style: none
margin-top: -1.3em margin-top: -7em
background-color: white background-color: white
@include box-shadow(1px 1px 4px gray) @include box-shadow(1px 1px 4px gray)
@include border-bottom-left-radius(0.4em) @include border-bottom-left-radius(0.4em)

View File

@ -1,9 +1,8 @@
-# Seems necessary, for the time being, to ensure calendar is changing days correctly -# Seems necessary, for the time being, to ensure calendar is changing days correctly
- Time.zone = 'Paris' - Time.zone = 'Paris'
= render '/regions/selector' - cache 'regions' do
= render '/regions/selector'
- cache do
= render '/lugs/search' = render '/lugs/search'
- if params[:year] - if params[:year]
@ -47,22 +46,21 @@
%strong.city= event.city.gsub '-', ' ' %strong.city= event.city.gsub '-', ' '
= event.title = event.title
- cache do .formats
.formats %em.fa.fa-rss
%em.fa.fa-rss =raw t '.calendar_in',
=raw t '.calendar_in', rss: link_to('RSS', events_url(:rss,
rss: link_to('RSS', events_url(:rss, tag: params[:tag], region: params[:region])),
tag: params[:tag], region: params[:region])), webcal: link_to('webcal', events_url(:rss,
webcal: link_to('webcal', events_url(:rss, tag: params[:tag], protocol: 'webcal', format: :ics, tag: params[:tag], region: params[:region])),
tag: params[:tag], protocol: 'webcal', format: :ics, tag: params[:tag], region: params[:region])), ical: link_to('iCal', events_url(:rss,
ical: link_to('iCal', events_url(:rss, tag: params[:tag], format: :ics, tag: params[:tag], region: params[:region]))
tag: params[:tag], format: :ics, tag: params[:tag], region: params[:region]))
%a#banner(href='http://april.org/campagne') %a#banner(href='http://april.org/campagne')
-#%img(src='http://www.april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april.png' -#%img(src='http://www.april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april.png'
width='580' height='76' alt='Priorité au Logiciel Libre! Je soutiens l\'April.') width='580' height='76' alt='Priorité au Logiciel Libre! Je soutiens l\'April.')
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png', = image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
width: '374', height: '48', width: '374', height: '48',
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.' alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
- set_events_meta - set_events_meta