#cdn #cache #xml #sitemap #url #how #cache-warmer

app warmer

A lightweight CDN cache warmer. A sitemap.xml is required for this to work. See README on how to use.

2 releases

0.1.2 Sep 8, 2023
0.1.1 Sep 5, 2023
0.1.0 Sep 4, 2023

#880 in Web programming

Download history 3/week @ 2024-02-13 16/week @ 2024-02-20 29/week @ 2024-02-27 2/week @ 2024-03-12 3/week @ 2024-03-26 42/week @ 2024-04-02 48/week @ 2024-04-16

93 downloads per month

GPL-3.0-or-later

27KB
282 lines

warmer

A CDN cache warmer in rust for the sitemap.xml files that look like this:

<?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>

Other examples of sitemaps that work

Usage

Download (from here) and run the executable binary on linux with the following command

warmer http(s)://someurl.com interl
 - ./warmer https://abh.ai 5
 - ./warmer https://abh.ai 1
  • The interval value should be specified in seconds, and it's how long the warmer waiting before loading the next URL in the sitemap.
  • The default interval is 5 seconds. No interval (0s) is allowed but use only if you want to DDOS your own site.
  • The complete url should be specified with scheme as well.

Build from source

  1. Clone the repo
  2. cd warmer
  3. Install cargo https://doc.rust-lang.org/cargo/getting-started/installation.html
  4. cargo build --release
  5. The binary will be in the target/release folder. It will also be named warmer
  6. You may need to install libudev-dev, libssl-dev, openssl, pkg-config, build-essential.

Running using docker

  1. docker pull abhaisasidharan/warmer
  2. docker run abhaisasidharan/warmer -it warmer https://abh.ai 5

Notes

Large sitemaps, that include other zipped or gzipped sitemaps are not supported yet. I'll release that as and when I get time. But for most sitemaps this should warm it just fine. Currently on supported on 64-bit linux OS.

Dependencies

~23–34MB
~554K SLoC