Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize File Listing Response for Folders #35

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Optimize File Listing Response for Folders #35

merged 1 commit into from
Nov 6, 2024

Conversation

berggren
Copy link
Contributor

@berggren berggren commented Nov 6, 2024

Summary:

This change introduces a compact file response schema for folder listings to improve performance and reduce response size.

Technical Details:

  • New Compact Schema: A new schema, FileResponseCompactList, has been created in src/api/v1/schemas.py. This schema includes only essential fields required for displaying file information within a folder listing: id, display_name, filesize, data_type, magic_mime, user (compact version), created_at, and is_deleted. This reduces the amount of data transmitted for folder listings.
  • Modified Folder File Listing Endpoint: The get_folder_files function in src/api/v1/folders.py has been updated to return a list of FileResponseCompactList objects instead of the full FileResponse objects. This significantly reduces the size of the response payload, improving performance, particularly when a folder contains a large number of files. This optimization focuses on providing just the necessary data for displaying file lists within a folder, avoiding the overhead of transmitting the complete file details.

@berggren berggren merged commit af765ed into main Nov 6, 2024
1 check passed
@berggren berggren deleted the less-data branch November 6, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant