Cache not working (AWS S3)

I am serving a website from an AWS S3 bucket (blob storage) and I cannot get cloudflare to serve the new version of my website. I had some updates, so I build a new version of the site and pushed it out to my S3 bucket. All of my scripts contain hashes, so they appear as different from the previous script.

I have:

  1. Turned off browser caching
  2. Purged and cleared the cloudflare cache
  3. Pointed the CNAME record to a different domain
  4. Delete all files in the S3 bucket, the site still worked
  5. Deleted and re-added the CNAME record
  6. Created a new S3 bucket with the new index.html file
  7. Tried different browsers and incognito mode
  8. Turned on developer mode

What am I missing?

Here is the S3 static site:

Here is the live page served via cloudflare:

If the page inspector is used, look for the last two script tags at the end of the body tag and you can see they are different.

The current page that is being served was never in the S3 bucket that the CNAME record is pointing to now.

Interestingly enough, every single URL from your domain shows up as DYNAMIC. So they’re not cached by Cloudflare.

Good catch. I am not sure where that file would be coming from, if not from cloudflare. The file being served doesn’t exist in my S3 bucket. Also if I delete the index.html entirely, the website still works. Is there any other cloudflare mechanism that could be causing this?

Cloudflare will pull content from wherever the DNS record points…unless you gave a thirty party Cloudflare Partner control over your domain at some point in the past.

If you toggle the :orange: so it’s :grey: DNS Only (and wait five minutes), does the site show up correctly?

Nope, still doesn’t show up correctly. I am going to try and swap to a different container storage provider and see if that helps

1 Like

Ok. Just leave it set to :grey: until you can get it working as expected and with HTTPS.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.