Fix for incorrect cache lifetime calculation