Add possibility to programmatically set cache mode, so it is possible
to cache only indexes/threads but not messages