When expires_in gets complicated you can simply use
:expires_in => lambda{ Time.now.to_i % 100 }
Code
class ActionController::Base def write_fragment_with_lambda_expire(key, content, options = nil) if options.is_a? Hash and options[:expires_in].is_a? Proc options = options.merge(:expires_in => options[:expires_in].call) end write_fragment_without_lambda_expire(key, content, options) end alias_method_chain :write_fragment, :lambda_expire end