💡
赛博大善人更新了全新的规则。
大善人非常善良的提供了一年的缓存服务,大大减少了源站开销,同时能抗住大量的CC。

规则

shell

(http.host eq "v.warhut.cn" and http.request.uri.path in {"/static" "/libs" "/data" "/iyplayer"}) or (http.request.uri.path.extension in {"7z" "avi" "avif" "apk" "bin" "bmp" "bz2" "class" "css" "csv" "doc" "docx" "dmg" "ejs" "eot" "eps" "exe" "flac" "gif" "gz" "ico" "iso" "jar" "jpg" "jpeg" "js" "mid" "midi" "mkv" "mp3" "mp4" "ogg" "otf" "pdf" "pict" "pls" "png" "ppt" "pptx" "ps" "rar" "svg" "svgz" "swf" "tar" "tif" "tiff" "ttf" "webm" "webp" "woff" "woff2" "xls" "xlsx" "zip" "zst"})
Shell
  1. 该规则对默认静态资源进行缓存,并且同时对指定路径下的所有内容进行缓存,以确保静态资源不会被cc。
  1. 攻击下面选项确保不会被使用查询字符串反复申请原站请求。在使用边缘 TTL时,使用了200以内的均缓存一年,201之后缓存2小时,以达到只缓存有效链接。
  1. 下面选项确保不会被使用查询字符串反复申请原站请求。

一、首先让我们找到

notion image

二、创建一个你想缓存的规则

notion image
可以看到上面,根据主机名,URL,等等一系列,都可以自定义你自己站点的缓存规则,并且!支持10条规则(不愧是大善人)

缓存条件

对所有包含以下扩展名的进行缓存:

shell

(http.request.uri.path.extension in {"7z" "csv" "gif" "midi" "png" "tif" "zip" "avi" "doc" "gz" "mkv" "ppt" "tiff" "zst" "avif" "docx" "ico" "mp3" "pptx" "ttf" "apk" "dmg" "iso" "mp4" "ps" "webm" "bin" "ejs" "jar" "ogg" "rar" "webp" "bmp" "eot" "jpg" "otf" "svg" "woff" "bz2" "eps" "jpeg" "pdf" "svgz" "woff2" "class" "exe" "js" "pict" "swf" "xls" "css" "flac" "mid" "pls" "tar" "xlsx" "rtf" "txt" "md" "tar.gz" "tar.bz2" "tar.xz" "xz" "psd" "ai" "mov" "wmv" "wav" "aac" "m4a" "obj" "stl" "json" "xml" "yml" "yaml" "bat" "sh" "py" "m3u8" "ts"})
Shell
更全面一点的:

shell

(http.request.uri.path.extension in {"gif" "jpg" "jpeg" "webm" "png" "webp" "svg" "bmp" "tiff" "tif" "mp3" "mp4" "avi" "mkv" "mov" "flv" "ts" "mts" "7z" "avif" "apk" "bin" "bz2" "class" "css" "csv" "doc" "docx" "ejs" "eot" "eps" "exe" "flac" "gz" "ico" "iso" "jar" "js" "mid" "midi" "ogg" "otf" "pdf" "pict" "pls" "ppt" "pptx" "ps" "rar" "svgz" "swf" "tar" "ttf" "woff" "woff2" "xls" "xlsx" "zip" "zst" "aac" "alac" "wav" "ape" "wma" "opus" "epub" "mobi" "azw" "azw3" "txt" "djvu" "cbr" "cbz"})
Shell

缓存配置

指定符合缓存条件的进行缓存,代表会将符合上面缓存条件的进行缓存。
绕过则是反之,通俗易懂。
边缘TTL就是cf将你的数据缓存在他的节点上,缓存多久,这里直接选1年,也可以选其它的,根据你实际情况。
为什么额外+状态码呢?因为有时候,服务器502了,不想被缓存,这个时候就可以指定状态码进行缓存。
这里默认了200缓存1年,404这种只需要缓存2个小时就够了,防止CC的攻击。
notion image
如果你需要缓存的是静态资源,并且不考虑时效性,或者服务器的有效性,直接像这样配置。
notion image
具体详细规则,请自己阅读文档噢,大部分静态资源通用以上规则,欢迎各位佬友分享自己的缓存规则,或者说方法~

附完整配置大图:

notion image
记录一下给Lsky Pro接口页面增加token生成按钮Linux简易搭建DDNS教程
Loading...
hexo