[BUGFIX beta] Add cache tests and fix undefined value
Merge pull request #9266 from mmun/cache-tests

[BUGFIX beta] Add cache tests and fix undefined value