add time_to_live param

Sorry for spaces over tabs (.