'Not authorized'])); $cacheDir = __DIR__.'/../../cache'; header('Content-Type: application/json'); if(!is_dir($cacheDir)){ echo json_encode(['error'=>'Cache folder not found']); exit; } $files = glob($cacheDir.'/*'); foreach($files as $f){ if(is_file($f)) unlink($f); } echo json_encode(['message'=>'Cache cleared']);