Add intelligent caching and auto-refresh for external calendars
Implements server-side database caching with 5-minute refresh intervals to dramatically improve external calendar performance while keeping data fresh. Backend changes: - New external_calendar_cache table with ICS data storage - Smart cache logic: serves from cache if < 5min old, fetches fresh otherwise - Cache repository methods for get/update/clear operations - Migration script for cache table creation Frontend changes: - 5-minute auto-refresh interval for background updates - Manual refresh button (🔄) for each external calendar - Last updated timestamps showing when each calendar was refreshed - Centralized refresh function with proper cleanup on logout Performance improvements: - Initial load: instant from cache vs slow external HTTP requests - Background updates: fresh data without user waiting - Reduced external API calls: only when cache is stale - Scalable: handles multiple external calendars efficiently 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2089,6 +2089,7 @@ impl CalendarService {
|
||||
#[derive(Deserialize)]
|
||||
struct ExternalCalendarEventsResponse {
|
||||
events: Vec<VEvent>,
|
||||
last_fetched: chrono::DateTime<chrono::Utc>,
|
||||
}
|
||||
|
||||
let response: ExternalCalendarEventsResponse = serde_wasm_bindgen::from_value(json)
|
||||
|
||||
Reference in New Issue
Block a user