Slide 36
Slide 36 text
Fixing the calendar cache: 6%
Keys like:
111325,111326,111327,111328,111329,111330,111331,111332,111333,111334,111335,111336,...
Code is:
key = @appointments.pluck(:id).sort.join(',')
@data = Rails.cache.fetch (key) do
Appointment.calendar_for(@appointments, @user).export
end
● How big is this key space?
○ All combination of appointment keys
● What’s wrong with this key?
○ Freakin nonsensical, no human words
● Do we need to cache this?
○ Sure but not with this key
TODO: use a better key, set expiration, delete existing keys