Updated to use Rails.cache instead of Mutex