Problem with Cache Control - Tigris
Problem with Cache Control
🟧AWS SDK❓Question
I don't know if I'm doing something wrong, but when I set a cache-control field on tigris it just ignores it:
aws s3 cp \
--content-type "application/json; charset=utf-8" \
--cache-control 'public, max-age=300' \
--metadata-directive REPLACE \
"$MY_FILE" \
"s3://$BUCKET_NAME/$MY_FILE" \
; \
sleep 60
; \
aws s3api head-object \
--bucket "$BUCKET_NAME" \
--key "$MY_FILE" \
--output json |
jq -r '.CacheControl'
# public, max-age=259200, stale-while-revalidate=3600, stale-if-error=600
The returned value is the bucket-wide default I have set (Bucket Settings -> Storage Settings -> Cache Control).
The description of the field ( This lets you set the default Cache-Control header for objects in the bucket) gives me the impression that it shouldn't smash my own settings.
Maybe it's some sort of timeout or data race since I first uploaded the file without a cache-control header before deleting/modifying it (UPDATE: happens on new files as well).
Giving it 60s seemed more than enough for everything to settle (Global, public bucket, Standard storage tier, Strict consistency, object ACLs enabled).
If these settings are incompatible in some way it would be a real shame since I really don't wanna manually set each cache-control, but I need some files to be short-lived
Response from @tigris-help-bot:
Thanks for reporting the issue. This seems to be a bug on our end where a bucket-level default Cache-Control was overriding the per-object value you set. We have a fix in progress and will let you know once it's deployed.
OP Follow-up:
Hey, sorry to bother y'all (no pressure), but do you have any estimates as to when this fix could be live?
Response from @tigris-help-bot:
Hey, sorry for the delayed response. We already have a fix implemented, but it still needs to be deployed. We should have it available sometime next week.
User @himank:
The fix has been rolled out. Could you please try?
OP Follow-up:
Seems to be working now (for at least a couple test files), thanks!
User @himank:
great