";
flush();
try {
// Render the summary-nocache view
$viewContent = view('admin.type.summary-nocache')->render();
// Ensure cache directory exists
if (!Storage::exists('cache')) {
Storage::makeDirectory('cache');
}
// Save to cache
Storage::put('cache/summary.blade.php', $viewContent);
// Save last update time
Storage::put('cache/summary_last_updated.txt', date('Y-m-d H:i:s'));
$fileSize = strlen($viewContent);
echo "✅ Cache updated successfully!
";
echo "File size: " . number_format($fileSize / 1024, 2) . " KB
";
echo "Last updated: " . date('Y-m-d H:i:s') . "
";
echo "
JavaScript buttons will be added dynamically when the page loads.
";
echo "
View Summary Page";
} catch (\Exception $e) {
echo "❌ Error updating cache: " . $e->getMessage() . "
";
echo "Memory used: " . number_format(memory_get_peak_usage() / 1024 / 1024, 2) . " MB
";
}
?>