We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6126
    • 25 Posts
    Hello,

    We recently moved a site to the Rackspace Cloud and at the same time upgraded from 0.9.6 to 1.0.2. Ever since we have been getting cache errors and database errors. Below are examples:

    Cache Error


    PHP error debug
    Error: file(assets/cache/docid_1127.pageCache.php) [function.file]: failed to open stream: No such file or directory
    Error type/ Nr.: Warning - 2
    File: /removed/www.quincynews.org/web/content/manager/includes/document.parser.class.inc.php
    Line: 369
    Line 369 source: $flContent= implode("", file($cacheFile));


    Anyone else use the cloud and encounter these errors? It is as if the cache file is not being written, the cache folder is chmod 777 so I don’t know why that would be occurring.

    We run several other sites on the cloud successfully but none of them have near this much traffic.
      • 6126
      • 25 Posts
      The siteCache.idx.php file is over 1.65MB. Is this normal? I overwrote it with one from a default install when first trying to fix the errors so this is just from the past few days.
        • 22303 MODX Staff
        • 10,725 Posts
        Depending on how many Resources and Elements make up your site, that could be a perfectly normal cache file size.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          If you are on a "cloud", it is possible that your files are being scattered across different servers, so the individual page cache files may end up on a different server than the one that fielded the request for the page. This used to be a problem with session files across distributed servers; most such configurations have by now figured out to use a single shared point for their /tmp storage.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: sottwell at Mar 17, 2010, 12:54 AM

            If you are on a "cloud", it is possible that your files are being scattered across different servers, so the individual page cache files may end up on a different server than the one that fielded the request for the page. This used to be a problem with session files across distributed servers; most such configurations have by now figured out to use a single shared point for their /tmp storage.
            Shouldn’t matter about the different servers; each would have it’s own cache, but, this could actually be a result of someone clearing the cache at the about the same moment the user request is made. i.e. it’s possible that the user making the request saw the cache file existing but it was deleted before the script actually opened it.
              • 6126
              • 25 Posts
              That makes sense, refreshing the content of the cache directory shows the files are being deleted about as quickly as they are added. I know the pages are not being updated that quickly and we did not have this problem with the same site on 0.9.6. I’ll peruse my snippets and see if I can find any cache related api calls.
                • 6126
                • 25 Posts
                I think I found it, I had a snippet that was changing the parent of older news stories every time a template was accessed and then clearing the cache. I’ll look at a better way of doing this since it is generating more database queries than necessary and negating the effectiveness of the cache. Thank you all for all your insights!

                UPDATE:
                I am very sure that was it.

                I was using $modx->clearCache() after moving the resource which totally wiped out the cache before the page loaded. It only did so when there was a resource to move. Question: is it necessary to clear the cache after changing a parent in the database?
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Quote from: pyrographics at Mar 17, 2010, 02:58 PM

                  I was using $modx->clearCache() after moving the resource which totally wiped out the cache before the page loaded. It only did so when there was a resource to move. Question: is it necessary to clear the cache after changing a parent in the database?
                  Definitely; this could change the URL structure, any code that gets children on the parents involved, and if anything depends on parent on that page...
                    • 6126
                    • 25 Posts
                    Thanks, I think I’ll move this to a cron job to run nightly and use the http://wiki.modxcms.com/index.php/ClearingTheMODxCache function instead of $modx->clearCache().