feat(cache): implement centralized caching layer for improved performance and reduced API calls
feat(microsoft-integration): enhance inbox and events fetching with caching support feat(auth): include theme and notification settings in user data retrieval feat(profile): improve password visibility toggle functionality feat(planner): optimize event synchronization with Outlook using caching fix(notifications): update mail badge handling for mobile and desktop
This commit is contained in:
@@ -11,8 +11,9 @@ require_once __DIR__ . '/includes/integrations/microsoft.php';
|
||||
$userId = (int)($currentUser['id'] ?? 0);
|
||||
$db = get_db_connection();
|
||||
|
||||
// Haal initiële inbox data op
|
||||
$inboxData = microsoft_fetch_inbox_messages($userId, 30);
|
||||
// Haal initiële inbox data op (met 45s cache, tenzij ?refresh=1)
|
||||
$forceRefresh = !empty($_GET['refresh']) && $_GET['refresh'] === '1';
|
||||
$inboxData = microsoft_fetch_inbox_messages($userId, 30, false, $forceRefresh);
|
||||
$messages = $inboxData['messages'] ?? [];
|
||||
$isDemo = !empty($inboxData['is_demo']);
|
||||
$unreadCount = (int)($inboxData['unread_count'] ?? 0);
|
||||
@@ -720,7 +721,7 @@ async function refreshMailbox() {
|
||||
if (icon) icon.classList.add('animate-spin');
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/mail.php?action=get_inbox');
|
||||
const res = await fetch('/api/mail.php?action=get_inbox&refresh=1');
|
||||
const data = await res.json();
|
||||
if (data.success && data.messages) {
|
||||
allMessages = data.messages;
|
||||
|
||||
Reference in New Issue
Block a user