Added requested checks on cache file

Signed-off-by: Antonio Uccio Verardi <antonio.uccio.verardi@gmail.com>