Add a global lock in a cache file to prevent top tags being regenerated many times