How data is loaded and cached
APIs: All data is loaded via the FleekDash REST API under /wp-json/fleekdash/v1/analytics/: visitors, pageviews, kpi-summary, real-time, popular-posts, user-registrations, recent-users, referrers, devices, geographic. Export and cache endpoints (e.g. cache/stats, cache/clear, cache/warm) exist for admins and automation.
Requests use the platform apiClient, so authentication (e.g. nonce) is handled automatically; no need to configure tokens in the UI.
React Query: The frontend uses React Query (TanStack Query) for all analytics requests. Query keys include the endpoint and params (e.g. time range), so data is cached and deduplicated. Changing the time range or toggling Live creates new or updated queries.
Backend caching: The backend can cache analytics results (e.g. via AnalyticsCacheService). Cache TTL and invalidation depend on server configuration. The dashboard stays fast when switching periods or revisiting the page.
Stale-while-revalidate: React Query's default behavior (stale time, refetch on window focus, etc.) applies, so you may see cached data first and then updated data after a refetch.
Predictable, fast loading and the option to clear or warm cache when needed.
<!-- seo-geo: content-enrichment -->
In practice
Analytics Dashboard — analytics API endpoints, React Query, and backend cache. On this page, How data is loaded and cached is covered in detail: what it looks like in the admin, the exact controls it exposes, and how it behaves when you use it day to day. Because how data is loaded and cached is part of Analytics Dashboard — KPI cards, time-series charts, and live indicators for routine site-health checks without a separate analytics plugin — the settings you touch here interact with the rest of the feature; when in doubt, open the feature overview and follow the docs in order.
See also
Need a hand? Contact support or head back to the Analytics Dashboard guide.