Learn about Centmin Mod LEMP Stack today
Register Now

cache warmer script (included)

Discussion in 'Feature Requests & Suggestions' started by ahmed, May 12, 2017.

  1. ahmed

    ahmed Active Member

    361
    49
    28
    Feb 21, 2017
    Ratings:
    +63
    Local Time:
    1:41 AM
    Hello

    this is an example for cache warmer script to be added after wordpress update script


    Code:
    #!/bin/bash
    ALIAS='@ddc.production'
    URL='DOMAIN'
    
    wget --quiet https://$URL/sitemap.xml --no-cache --output-document - | egrep -o "https://$URL[^<]+" | while read line; do
        time curl -A 'Cache Warmer' -s -L $line > /dev/null 2>&1
        echo $line
    done
    echo  cache warmed
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    49,877
    11,487
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,839
    Local Time:
    9:41 AM
    Nginx 1.21.x
    MariaDB 10.x
    Nice thanks for sharing definitely something useful. I have been working on something similar for sites in general and not just wordpress. So we shall see :)