Skip to content

Instantly share code, notes, and snippets.

@mklooss
Last active November 21, 2024 08:28
Show Gist options
  • Save mklooss/fcb8975b12eadc947bc0a823ec510804 to your computer and use it in GitHub Desktop.
Save mklooss/fcb8975b12eadc947bc0a823ec510804 to your computer and use it in GitHub Desktop.
Cachewarm with lynx and all links on page
#!/bin/bash
# get data with curl, lynx only support http/1.0
curl -s --connect-timeout 10 --max-time 10 -o /tmp/shopdomain.tld.html https://www.shopdomain.tld/
for i in $(lynx --listonly --nonumbers --display_charset=utf-8 --dump /tmp/shopdomain.tld.html | grep shopdomain.tld | sort | uniq | sort --random-sort | grep -v 'checkout\|wishlist\|contact\|customer\|account'); do
echo $i
curl -s --connect-timeout 10 --max-time 10 $i > /dev/null
date
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment