当临时对于js css html 图片等文件进行变更时,由于相关资源在CloudFront中存在缓存,无法直接看到变更后的状态,需要手动操作进行缓存的清理。

解决的方案,使用AWS CLI进行特定路径缓存的清理:

点击AWS页面右上角的terminal图标,进入AWS CLI:

使用create-invalidation命令,触发文件失效:
aws cloudfront create-invalidation –distribution-id EDFDVBD6EXAMPLE –paths “/example-path/index.html”
样例:
aws cloudfront create-invalidation –distribution-id EDFDVBD6EXAMPLE –paths /wp-includes/*
aws cloudfront create-invalidation –distribution-id EDFDVBD6EXAMPLE –paths /wp-content/*

本站点维护了一个每日更新的华语youtuber的排行榜,欢迎点击收藏
https://chuizi.tech/ytrank/

最后修改日期: 2023年10月11日

留言

撰写回覆或留言

发布留言必须填写的电子邮件地址不会公开。