Conditional queries
Conditional Requests in the S3 API allow you to perform operations only if certain conditions are met by using headers.You can use them:
- perform read and write requests with a preliminary check of the object state;
- manage updates and downloads of objects based on their current state or metadata;
- conform to the familiar scenarios of working to S3 standards;
- protect data from accidental overwriting;
- optimize traffic costs.
Conditional queries can be used for different scenarios.
Headings
PutObject operations
CopyObject and UploadPartCopy operations
DeleteObject operations
CompleteMultipartUpload operations
Error description
Examples of use cases
- update conflict protection — the object will be updated only if it has not changed since the last invocation (
If-Matchheader); - data synchronization — the object will be loaded only if it was changed after the specified time (
If-Modified-Sinceheader); - read optimization — the object will be retrieved only if it does not match the local version (
If-None-Matchheader); - overwriting protection — the object will not be written by key
ifthere is already another object with the same key (If-None-Matchheader).