Skip to content
inverse-paradoxPublic

About

Shell script to warm up page cache from a sitemap or URL list.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

warmup

Shell script to warm up page cache from a sitemap or URL list.

Overview

warmup fetches every URL listed in an XML sitemap (or sitemap index) and discards the response, triggering the server to populate its page cache for each URL. It also supports plain-text URL lists. Sitemap index files are handled recursively — all child sitemaps are discovered and processed automatically.

Requirements

  • bash
  • curl
  • bc (only required when using --wait)

Installation

Run the install script to copy warmup to /usr/local/bin and make it executable:

sudo ./install.sh

After installation, you can run it from anywhere:

warmup https://www.example.com/sitemap.xml

Usage

warmup <url> [options]

Arguments

Argument Description
<url> URL of the sitemap (XML) or URL list (plain text) to process.

Options

Option Description
--bare, -b Treat the file at <url> as a plain-text list of URLs (one per line). Blank lines and lines beginning with # are ignored.
--wait=<ms>, -w=<ms> Add a delay of <ms> milliseconds between requests. Default: 0 (no delay).
--append-params=<params> Append an already URL-encoded query string to every fetched URL, including sitemap and list URLs. Separate parameters with & or repeat the option.
--help, -h Show the help message and exit.

Examples

Warm up all pages in an XML sitemap:

warmup https://www.example.com/sitemap.xml

Warm up all pages from a sitemap index file:

warmup https://www.example.com/sitemap_index.xml

Warm up all pages in a sitemap with a 200 ms delay between requests:

warmup https://www.example.com/sitemap.xml --wait=200

Warm up pages from a plain-text URL list with a 500 ms delay:

warmup https://www.example.com/urls.txt --bare --wait=500

Append multiple parameters to every request:

warmup https://www.example.com/sitemap.xml --append-params='nocache=1&source=warmup'

Supply parameters without a leading ? or &, and URL-encode their names and values as needed. Quote the argument to prevent the shell interpreting &.

How It Works

XML Sitemap Mode (default)

  1. The provided URL is fetched and parsed as XML.
  2. If the document is a sitemap index (contains <sitemap> elements), all child sitemap URLs are extracted and queued for processing.
  3. If the document is a regular sitemap (contains <url> elements), all <loc> URLs are extracted and each one is fetched in sequence using curl.
  4. Sitemap indexes may nest multiple levels deep — warmup will keep processing until all child sitemaps are exhausted.

Plain-Text URL List Mode (--bare)

  1. The provided URL is fetched as plain text.
  2. Each line is treated as a URL. Blank lines and lines beginning with # are skipped.
  3. Each URL is fetched in sequence using curl.

Request Behavior

  • Responses are discarded (-o /dev/null) — only the request is made.
  • Redirects are followed automatically (-L).
  • A custom User-Agent (CacheWarmerBot/1.0) is sent with each request.
  • An optional delay (--wait) can be added between requests to avoid overwhelming the server.

License

See LICENSE.

About

Shell script to warm up page cache from a sitemap or URL list.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages