We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    I don't have an answer to your question, but I'm working on a utility snippet that deletes the cache files. Hopefully, it will be out later today.

      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
      • 23018
      • 353 Posts
      Quote from: BobRay at Dec 15, 2012, 07:50 PM
      I don't have an answer to your question, but I'm working on a utility snippet that deletes the cache files. Hopefully, it will be out later today.

      One out of three things I know about MODx I learned from your your blog or your posts at the forum. If you don't haven an answer, there is no hope for us... wink.

      Would you mind telling us a bit more about your new snippet and why you wrote it?

      Regards,

      pepebe
      [ed. note: pepebe last edited this post 11 years, 4 months ago.]
        Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
        • 3749
        • 24,544 Posts
        It seems people are often manually clearing the cache. I just thought I'd make it easier to do from inside the Manager. The Extra is called CacheClear.
          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
        • This does create an issue BobRay. Since 2.2, "clearing" the cache is actually refreshing it. For instance, the system_settings and context_settings cache entries are never deleted, only updated when refresh is called. Also, there are a number of files in the core/cache/ directory that should not necessarily be manually removed.

          I'll review this in more detail and provide more in-depth feedback soon.
          • One fairly common problem with the cache appears to be some kind of corruption of the permissions so that MODx can't remove or update the files and they have to be removed manually by the FTP user.

            Twice now I've gotten system errors relating to not being able to do something or another with a cache or a lexicon file - in the Cloud.
              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
              • 3749
              • 24,544 Posts
              Yes, Susan's issue is what I meant to address. I've seen many reports from people for whom Site | Clear Cache did not fix a problem, but manually deleting all files in the core/cache directory did. In some cases, people report having to do this regularly.

              I've deleted all cache files on 2.2 many times with no ill effects.

              If there is truly an issue with just deleting those files, I'll be happy to have the extra removed. Or, as an alternative, I could modify it to skip files that shouldn't be removed.

                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
              • Quote from: sottwell at Dec 16, 2012, 05:11 PM
                Twice now I've gotten system errors relating to not being able to do something or another with a cache or a lexicon file - in the Cloud.
                In Cloud, those are related to bugs occurring outside of MODX, i.e. when creating snapshots, because those processes have to run as root and then correct permissions. Under normal operations, you should not have to manually clear the cache, ever. In fact, having to do so indicates there is a bug being encountered which needs to be addressed, not swept under the rug.
                  • 38121
                  • 36 Posts
                  We're seing the "Unexpected token '<'" error sporadically in the manager on a shared server (php 5.4.6) with Revo 2.2.6 tradi. upgraded from 2.2.5. However we've never experienced it on the dev server (MAMP 2.1.1, php 5.3.14, 5.4.4).

                  - Modx error log is empty.
                  - Files were transfered via scp as a zip archive and unzipped on the server, so it's not related to FTP transfer.
                  - MIGx and Version X are _not_ installed, so it shouldn't be related to these.
                  - compress_js is off

                  I turned off compress_css and will watch for changes (I don't expect to see a change though).

                  Apache error log does report interesting things:

                  Premature end of script headers: index.php, referer: http://heliantheme.com/manager/index.php?a=30&id=45
                  [Fri Dec 28 09:12:17 2012] [error] [client ip address stripped] [host domain name stripped] Premature end of script headers: index.php, referer: domain.tld/manager/index.php?a=30&id=45
                  [Fri Dec 28 09:12:17 2012] [error] [client ip address stripped] [host domain name stripped] Premature end of script headers: derivatives.php, referer: domain.tld/manager/index.php?a=30&id=45
                  [Fri Dec 28 09:12:17 2012] [error] [client ip address stripped] [host domain name stripped] Premature end of script headers: contenttype.php, referer: domain.tld/manager/index.php?a=30&id=45
                  [Fri Dec 28 09:12:17 2012] [error] [client ip address stripped] [host domain name stripped] Premature end of script headers: template.php, referer: domain.tld/manager/index.php?a=30&id=45
                  [Fri Dec 28 09:12:18 2012] [error] [client ip address stripped] [host domain name stripped] Premature end of script headers: phpthumb.php, referer: domain.tld/manager/index.php?a=30&id=45
                  [Fri Dec 28 09:12:18 2012] [error] [client ip address stripped] [host domain name stripped] Premature end of script headers: register.php, referer: domain.tld/manager/index.php?a=30&id=45


                  (id=45 is a resource)

                  So far I suspect the error is due to resource throttling on the shared server.
                  • Make sure error_reporting is not showing everything and that display_errors is Off as well. Having this enabled can break AJAX requests when PHP warnings or notices are encountered which are otherwise harmless to the functionality.
                      • 38121
                      • 36 Posts
                      Good catch ^_^ display_errors is On and error_reporting does show everything.

                      I won't be able to modify display_errors as the site is on a shared server... As for error_reporting, would you suggest to set it to E_ERROR?

                      So just to make sure, are you saying that the 'Premature end of script headers' are harmless, ie. not errors but notices?