# 🔥 Aladtec Cache Management Tools

Hebron Fire Protection District

## 🎯 Purpose

These tools help you monitor and manage the Aladtec cache refresh system. The cache automatically updates at 8:00 AM and 8:00 PM Eastern Time to sync staffing, time-off, and event data.

📊
PRIMARY TOOL
Diagnostics Dashboard
Comprehensive monitoring dashboard showing cache status, refresh history, API health, and cron job status. Check this daily to ensure the system is working correctly.
Open Dashboard →
🕐
SETUP TOOL
Timezone Checker
Automatically detects your server's timezone and calculates the exact cron times needed for 8 AM and 8 PM Eastern refreshes. Use this when setting up cron jobs.
Check Timezone →
🧪
TESTING TOOL
Cron Command Tester
Tests the cron refresh command to ensure it works correctly before adding it to cPanel. Simulates what happens when the cron job runs.
Run Test →
📈
ADVANCED
Cache Statistics (JSON)
Raw JSON output showing detailed cache statistics, file ages, poll counts, and system configuration. Useful for debugging and technical analysis.
View Stats →
🔄
MANUAL ACTION
Manual Refresh
Trigger an immediate cache refresh (limited to 50 per day, 30 minute intervals). Use this for testing or when you need fresh data immediately.
Go to Dashboard →
🎯
MAIN DASHBOARD
Hebron Dashboard
Your main operational dashboard showing staffing, incidents, weather, and all live data. This is what displays on the TV screens.
Open Dashboard →

## 🚀 Quick Setup (If Not Done Yet)

If you haven't set up the automatic cron jobs yet, follow these steps:

- Step 1: Visit the Timezone Checker and note the cron times
- Step 2: Log into cPanel → Cron Jobs
- Step 3: Add two cron jobs (one for 8 AM, one for 8 PM) using the times from Step 1
- Step 4: Verify setup in the Diagnostics Dashboard

Documentation: README • Setup Guide • cPanel Guide • Checklist

## ⚙️ How The Cache System Works

Automatic Refreshes: Cron jobs trigger refreshes at 8:00 AM and 8:00 PM Eastern (shift change times)

Cache Files: 6 JSON files store staffing, time-off, shift labels, events, members, and accrual data

API Limits: Maximum 50 refreshes per day, minimum 30 minutes between refreshes

Monitoring: All refresh attempts are logged and visible in the diagnostics dashboard

## 🚦 What To Look For

✅ GREEN (Fresh): Cache is less than 2 hours old - everything is working correctly

⚠️ ORANGE (Stale): Cache is older than 2 hours - refresh may be needed

❌ RED (Error): Cache is missing or refresh failed - needs attention