We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Is there a way to bulk cache hundreds of resources without opening every link to push it into cache? I know I can bulk uncache but can I bulk cache?
    Thanks
      • 3749
      • 24,544 Posts
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 12410
        • 353 Posts
        Thanks...jut ran it there on 300+ resources and it finished after 4 seconds? Is CacheMaster conflicting with it I wonder?
          • 3749
          • 24,544 Posts
          No, it shouldn't. You can see if it worked by looking in the core/cache directory.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 12410
            • 353 Posts
            Hi Bob,
            I know if my home page is cached it will generate 1 query and take 0.3 seconds to load using
            <meta name="generator" content="Query time: [^qt^] ([^q^] Queries) // Parse time: [^p^] // Total time: [^t^] // Source: [^s^]">
            syntax

            Uncached its 30+ queries and 4 seconds loading

            If I run the RefreshCache extra I'm expecting this to cache all my 300 resources so they all open quickly and execute about 1 query each.

            not quite sure what to look out for in core/cache because there's always 14 folders in there whether cache is cleared or not and chmod on cache folder is 777.

            Maybe I'm missing something or havent activated some setting?
            Thanks
              • 3749
              • 24,544 Posts
              Look in core/cache/resource/web/resources. Each file is a cached resource. Either there will be a whole lot of resources there or there won't (assuming that the resources are set as cacheable).
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 12410
                • 353 Posts
                Hi Bob,
                Thanks. Yes the resources are all checked as cacheable. If I run RefreshCache it neither adds nor deletes any files. If I have created resources 1 thru 100 in Mode Revo should running RefreshCache create these in core/cache/resource/web/resources as ..core/cache/resource/web/resources/1 ....core/cache/resource/web/resources/2........upto core/cache/resource/web/resources/100?
                Is that the idea? The fact that RefreshCache runs for 2 to 3 seconds (as opposed to 15 minutes as alluded to in docs) when the core/cache/resource/web/resources folder is entirely empty suggests there's some conflict with the functionality.

                I have a .htpasswd on the public_html root folder but I doubt that matters. Would APC on the server affect it. It's the modxcloud server setup

                I remember months back I ran RefreshCache on another project and it did process for 10-15 minutes. Not quite sure whats causing it to run for under 3 seconds this time though. Server config maybe?

                Thanks [ed. note: howster last edited this post 9 years, 3 months ago.]
                  • 3749
                  • 24,544 Posts
                  I've never tried it on Cloud, but I have observed that Cloud has a very fast server. The numbers in the cache file names are the IDs of the resources, so it would be unlikely that they'd run from 1 to 100.

                  If the cacheable resources are already cached, RefreshCache will run much faster. It does the equivalent of visiting every page and those pages will load much faster if they are already in the cache. APC could definitely make it faster yet. Even if you deleted all files in the MODX resource cache, they might still be in the APC cache.

                  The bottom line is if you delete all the files in the resource cache, then run RefreshCache, they should all reappear in the resource cache. If they do, RefreshCache is working.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 12410
                    • 353 Posts
                    That extra won't work for me unfortunately so. Just doesn't create the cache files you stated. I will report back if I find the solution. Thanks
                      • 3749
                      • 24,544 Posts
                      Possibly cURL is misconfigured or disabled, or the host is blocking multiple requests from the same location as a perceived DOS attack.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting