2个版本
0.1.2 | 2023年9月8日 |
---|---|
0.1.1 | 2023年9月5日 |
0.1.0 |
|
#5 in #cdn
27KB
282 行
warmer
用于类似这样的sitemap.xml文件的Rust CDN缓存预热器
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/sitemap.xsl"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://abh.ai/</loc>
<lastmod>2022-06-25T20:46Z</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://abh.ai/photos/nature</loc>
<lastmod>2022-09-25T05:33Z</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://abh.ai/portraits</loc>
<lastmod>2022-09-24T18:42Z</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
</urlset>
其他可工作的sitemap示例
- https://abh.ai/sitemap.xml
- https://qed42.com/sitemap.xml
- https://www.australia.gov.au/sitemap.xml
- https://www.alkhaleej.ae/sitemap.xml?page=1
- https://www.axelerant.com/sitemap.xml
- https://ffw.com/sitemap.xml
用法
下载(从这里)并在Linux上使用以下命令运行可执行二进制文件
warmer http(s)://someurl.com interl
- ./warmer https://abh.ai 5
- ./warmer https://abh.ai 1
- 间隔值应以秒为单位指定,这是预热器在加载sitemap中的下一个URL之前等待的时间。
- 默认间隔为5秒。不允许使用间隔(0s),但只有在你想要DDoS自己的网站时才使用。
- 应指定带有方案的完整URL。
从源码构建
- 克隆仓库
- cd warmer
- 安装cargo https://doc.rust-lang.net.cn/cargo/getting-started/installation.html
- cargo build --release
- 二进制文件将位于target/release文件夹中。它也将被命名为
warmer
- 你可能需要安装
libudev-dev
、libssl-dev
、openssl
、pkg-config
、build-essential
。
使用Docker运行
- docker pull abhaisasidharan/warmer
- docker run abhaisasidharan/warmer -it warmer https://abh.ai 5
注意
尚不支持包含其他压缩或gzip压缩的sitemap的大sitemap。我会在我有时间时发布它。但对于大多数sitemap,这应该可以很好地预热。目前仅在64位Linux操作系统上受支持。
依赖关系
~17–26MB
~447K SLoC