0
votes

For a S3 bucket, I want my all .jpg objects from Cloudfront (i.e. '.jpg' objects having Cloudfront URL) get served from disk / memory cache.

I can't go with the way of adding cache-control header or expires header in S3 object's properties - metadata by visiting each of them, because I have more than 100k .jpg files in whole bucket.

To add this cache control header to all objects - one of my colleagues had ran some script by S3 browser and due to this file type has changed to 'binary/octet-stream'. The script/command he ran I guess it's something like-

./s3cmd --recursive modify --add-header="Cache-Control:public ,max-age= 31536000" s3://your_bucket_name/

So, now I want to avoid these incorrect changes and with that also want to set caching for only '.jpg' objects/files and not all objects from bucket.

How can I do that? The server I am using is Litespeed and not Apache.

1

1 Answers

0
votes

Try add --include "*.jpg" --exclude "*.*" into your command.