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.
Summary:
This change introduces a compact file response schema for folder listings to improve performance and reduce response size.
Technical Details:
FileResponseCompactList
, has been created insrc/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
, andis_deleted
. This reduces the amount of data transmitted for folder listings.get_folder_files
function insrc/api/v1/folders.py
has been updated to return a list ofFileResponseCompactList
objects instead of the fullFileResponse
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.