mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 16:28:15 +00:00
feat(get): SF06 - conditional lifecycle check
Only call resolve_put_object_expiration when the object has an x-amz-expiration metadata marker. This avoids unnecessary lifecycle configuration reads on every GET request. Expected impact: 50-100us reduction per GET request. Closes rustfs/backlog#771 Co-Authored-By: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -3294,7 +3294,12 @@ impl DefaultObjectUsecase {
|
||||
});
|
||||
|
||||
// x-amz-expiration: predict from lifecycle configuration
|
||||
let expiration = resolve_put_object_expiration(bucket, &info).await;
|
||||
// Only resolve if the object has an expiration marker
|
||||
let expiration = if info.user_defined.contains_key("x-amz-expiration") {
|
||||
resolve_put_object_expiration(bucket, &info).await
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let storage_class = response_storage_class(&info, &info.user_defined);
|
||||
let content_disposition = info.user_defined.get("content-disposition").cloned();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user