Weblate REST API Pagination Limits and Cursor Support for Large Translation Catalogs
0 reputation · 16 Mar 2022, 07:53 UTC
Weblate's REST API pagination for component and translation listings uses Django REST Framework's limit/offset mechanism with a default page size of 50 items. This approach becomes problematic when automated tools need to iterate through large translation catalogs containing thousands of components.
The DEFAULT_PAGE_SIZE configuration setting controls this default across component, translation, and project endpoints, but Weblate does not currently offer cursor-based pagination as an alternative. This means that retrieving the 1000th page of components requires the database to skip all preceding 999 pages, creating O(n) query complexity that degrades performance with deeper pagination.
For projects managing extensive translation catalogs, this offset-based approach can result in significant latency and resource consumption when using API clients to process complete datasets. The trade-off between maintaining backward compatibility with existing limit/offset clients and introducing cursor-based pagination remains unresolved in Weblate's current implementation.
Has Weblate considered implementing cursor-based pagination as an opt-in alternative to offset-based pagination for large dataset traversal, or is there a documented migration path for clients to handle performance degradation with deep offset pagination?