Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 static site serves old contents

My S3 bucket hosts a static website. I do not have cloudfront set up.

I recently updated the files in my S3 bucket. While the files got updated, I confirmed manually in the bucket. It still serves an older version of the files. Is there some sort of caching or versioning that happens on Static websites hosted on S3?

I haven't been able to find any solution on SO so far. Note: Cloudfront is NOT enabled.

like image 730
Akshay Khetrapal Avatar asked Sep 02 '16 06:09

Akshay Khetrapal


People also ask

Can Amazon S3 run a static website?

After you create a bucket, you can enable static website hosting for your bucket. You can create a new bucket or use an existing bucket. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ .

How static files are served in AWS?

In the navigation pane, choose Configuration. In the Software configuration category, choose Edit. In the Static files section, enter a path for serving static files and the directory of the static files to serve into the empty row at the bottom of the list.

What is static website in S3?

You can use Amazon S3 to host a static website. On a static website, individual webpages include static content. They might also contain client-side scripts. By contrast, a dynamic website relies on server-side processing, including server-side scripts, such as PHP, JSP, or ASP.NET.


1 Answers

Is there some sort of caching or versioning that happens on Static websites hosted on S3?

Amazon S3 buckets provide read-after-write consistency for PUTS of new objects and eventual consistency for overwrite PUTS and DELETES

what does this mean ?

If you create a new object in s3, you will be able to immediately access your object - however in case you do an update of an existing object, you will 'eventually' get the newest version of you object from s3, so s3 might still deliver you the previous version of the object.

I believe that starting some time ago, read-after-write consistency is also available for update in the US Standard region.

how much do you need to wait ? well it depends, Amazon does not provide much information about this.

what you can do ? no much. If you want to make sure you do not have any issue with your S3 bucket delivering the files, upload a new file in your bucket, you will be able to access it immediately

like image 107
Frederic Henri Avatar answered Oct 05 '22 09:10

Frederic Henri