Proper cache config
Multiple small improvements raised from code review