I needed this for priming some image-heavy pages that were slow to cold-load after a cleared cache.
It's ideal for pages with some form of lazyloading / async content pulled from a CDN or a CMS where the first request can take an unacceptably long time to fulfill.
It also generates full page screenshots which can be used in QA or rudimentary visual regression testing.
npm i puppeteer yargs chalk-animation
- Create a file accessible over the network containing a simple list of URLs to warm.
- Put
make-warm.js
andwarm.sh
together in a folder and make sure they are executable.
The script needs one argument (the network location of the file we want to fetch). You can optionally add a username and password if your site is behind authentication.
./warm [http://location/of/cache-data.whatevs] [optional username] [optional password]
Ideas improvements bugs 👉 @kerns