We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46718
    • 39 Posts
    Hey there community!

    I have a large MODX Revo 2.2.13 install that does a big API import overnight and creates/updates resources with the data pulled.

    After the script is run, I clear the site cache so that the new information shows up properly when using getResources on my search page. Here's a link to the site for reference: http://www.scoutshonor.org/dogs

    So, the question: How do I manually regenerate the cache?


    After reading this post (https://forums.modx.com/thread/?thread=70679&page=2) I can probably refactor my importer to only clear the cache from the search result page, but even then, I'd like a way to regenerate the cache for the whole site in case it ever gets cleared, or at least for the search results page so that the first user every day doesn't have a super slow experience.

    Thanks for any help,
    Roger

    This question has been answered by frogabog. See the first response.

    • discuss.answer
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      http://bobsguides.com/refreshcache-tutorial.html

      It could be a little slow with a large site, as noted, but it does the job you're looking to do.

      You may also be interested in this other nifty little extra: http://bobsguides.com/cachemaster-tutorial.html

      Both packages are available via package management.
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 46718
        • 39 Posts
        Perfect thanks! I have CacheMaster already installed, but RefreshCache is what I needed, I guess I didn't see it in the Package Browser.

        I'm running the import with a cron job at night, so I'll just trigger this snippet right after and won't have to worry too much about how long it takes.