if (($GLOBALS['cache_instance']->loadCacheFile('refdepths')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
// Load referral system from cache
$GLOBALS['cache_array']['refdepths'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif (isHtmlOutputMode()) {
+} elseif ((isHtmlOutputMode()) || (isRawOutputMode())) {
// Create cache file here
$GLOBALS['cache_instance']->init();