Difficulty: Difficult
Description:
The Stats page (/stats) currently takes a long time to load due to a single API endpoint (/api/stats) serving all chart and table data at once.
A recent network request shows a 19.34-second load time, which impacts user experience — especially on slower connections or mobile devices.
The /api/stats endpoint currently returns a large JSON payload containing data for multiple chart components (averages, detailed_stats, distribution, growth_trends, and yoy_change). Each graph and table consumes part of this data, but all are fetched together on initial load.
Splitting the endpoint into smaller, independent ones for each visualization could improve perceived load time and allow progressive rendering of charts.
Request Example:
- GET https://isa.toolforge.org/api/stats
- Response size: 1.9 KB
- Response time: ~19.34s
Suggested Improvement:
Split the /api/stats endpoint into smaller endpoints, for example:
- /api/stats/growth_trends
- /api/stats/yoy_change
- /api/stats/distribution
- /api/stats/averages
- /api/stats/detailed
Implement parallel AJAX requests in the frontend (stat.html) using $.when() or Promise.all() so charts load independently.
Optionally add lazy-loading for non-critical charts (e.g., table data only after charts load).