Fix performance for env scanning

Also scan for jobs in the absolute path
Merge pull request #12650 from makinacorpus/cachef

Fix performance for env scanning