我的 Cloudflare 网站需要几个小时才能加载 CSS

My Cloudflare site is taking hours to load CSS

我在 CloudFlare 上创建了一个域,这是一个包含 HTML 和 CSS 的网站,将我的存储桶与这些文件一起托管在 S3 上,并集成了用于部署的 Terraform。当我启动 terraform apply 和 运行 aws cli 命令来更新 S3 存储桶时,格式更改(如文本)会立即显示,但我的 CSS 更改(如字体大小和颜色)需要几个小时才能看到。如何使这两种类型的更改快速可见?

我努力重新加载我的浏览器,清除缓存,并在 cloudflare 上设置自动缩小。我还没有尝试压缩我的 css 和 min.css 文件,有点担心我可能会破坏某些东西。我不熟悉前端开发。建议?

对于代理(“橙色云”)DNS 记录,Cloudflare 应用默认缓存行为。这包括默认缓存的文件扩展名,例如 CSS 文件。默认行为、缓存和扩展缓存是 documented here.

当您在源(S3 存储桶)上发布时,您可以 purge the cache so that the old cached versions are discarded and new ones will be pulled and cached. You can also override the cache behaviour by using Page Rules. By the way, Page Rules (and other Cloudflare settings) are also manageable via Terraform