# File lib/caches/cachetastic_caches_base.rb, line 23 def set(key, value, expiry = (store.all_options["default_expiry"] || 0)) do_with_logging(:set, key) do exp_swing = store.all_options["expiry_swing"] if exp_swing swing = rand(exp_swing.to_i) case rand(2) when 0 expiry = (expiry.to_i + swing) when 1 expiry = (expiry.to_i - swing) end end store.set(key.to_s, marshall(value), expiry.to_i) logger.info('', '', :expiry, cache_name, key, expiry.to_i) value end end