Files
html/api/visual-management-data.php
opus 147e87b5fb
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
auto-sync-opus46
2026-04-20 14:14:19 +02:00

18 lines
519 B
PHP

<?php
// V93 cached wrapper - fixes 8sec psql queries
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('X-V93-cache: 60s-wrapper');
$cache = '/tmp/visual-management-data.cache.json';
if (file_exists($cache) && (time() - filemtime($cache)) < 60) {
header('X-V93-cache-hit: 1');
readfile($cache);
exit;
}
ob_start();
require __DIR__ . '/visual-management-live.php';
$body = ob_get_clean();
@file_put_contents($cache, $body);
header('X-V93-cache-hit: 0');
echo $body;