In how to add cache control in AWS S3? someone said that
./s3cmd
--recursive modify
--add-header="Cache-Control:max-age=86400"
s3://yourbucket/
as the correct command to add cache-control (and also expires) headers, but many people then said that it removed accessibility to the files (access denied).
Apparently it works if you run it folder by folder but that's not easy when you have thousands of folders.
What is the correct command to avoid this?
UPDATE 1: Could using --add-header='Cache-Control:max-age=86400, public'
be a solution?