diff --git a/includes/functions.php b/includes/functions.php index fa4dc0b8..f1dec2c0 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -492,9 +492,11 @@ function readCache($key) function writeCache($key, $data) { - mkdir(RASPI_CACHE_PATH, 0777, true); - $cacheKey = expandCacheKey($key); - file_put_contents($cacheKey, $data); + if (!file_exists(RASPI_CACHE_PATH)) { + mkdir(RASPI_CACHE_PATH, 0777, true); + $cacheKey = expandCacheKey($key); + file_put_contents($cacheKey, $data); + } } function deleteCache($key)