extract worker count caching and add a redis cache