Skip to content

Commit

Permalink
Merge pull request #958 from ImageMarkup/increase-paginated-cache-uti…
Browse files Browse the repository at this point in the history
…lization
  • Loading branch information
danlamanna committed Sep 11, 2024
2 parents 5c16a2c + b8de447 commit 2d14be5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion isic/core/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def paginate_queryset(
# If we have an offset cursor then offset the entire page by that amount.
# We also always fetch an extra item in order to determine if there is a
# page following on from this one.
results = list(queryset[cursor.offset : cursor.offset + limit + 1])
# Always fetch the maximum page size to increase cache utilization.
results = list(queryset[cursor.offset : cursor.offset + self.max_page_size + 1])
page = list(results[:limit])

# Determine the position of the final item following the page.
Expand Down

0 comments on commit 2d14be5

Please sign in to comment.