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

    my siteCache.idx.php is currenty over 700Kb and I have no idea of what it is for (seems full of code-snippets, config vars, and other interesting things).

    When I click ’[tt]Clear-cache[/tt]’ in the manager I get:

    Cache: Found 3 files in cache directory and deleted 0 cache files.
    (why?)

    should I delete it manually every now and then ??!?


    ciao
      ----------------------------------------------------------
      http://www.linkedin.com/in/lucapost/
      http://www.twitter.com/lukwe/
      ----------------------------------------------------------
      • 22303 MODX Staff
      • 10,725 Posts
      No, don’t ever delete that file, as it is critical for every request. This contains a map of all the documents in your site, as well as the source code for all your chunks, snippets, and plugins. 700k tells me you either have a lot of documents (1000’s), or are keeping a lot of PHP code in your database (or both). There are some recent threads covering suggestions to include your php source code from external files to relieve the size of this file a bit.

      Whenever something is saved and the cache cleared, this file is regenerated immediately.
        • 17673
        • 194 Posts
        I do have many Snippets hanging in there which I am not using;
        could this affect performance? does MODx have to go trhought the file at each request ??!?
          ----------------------------------------------------------
          http://www.linkedin.com/in/lucapost/
          http://www.twitter.com/lukwe/
          ----------------------------------------------------------
          • 22303 MODX Staff
          • 10,725 Posts
          Definitely and yes, every request loads this file; this is one of the bottlenecks being addressed with the 0.9.7 rewrite.
            • 17673
            • 194 Posts
            wow I just posted about this for curiosity sake, but it’s getting interesting!

            which are the threads you mentioned about moving the php code to external files ??!?
              ----------------------------------------------------------
              http://www.linkedin.com/in/lucapost/
              http://www.twitter.com/lukwe/
              ----------------------------------------------------------
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Another good source of snippet "best practices":

              http://wiki.modxcms.com/index.php/Creating_Snippets
                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
                • 17673
                • 194 Posts

                I cut the file-size from 750kb to 600kb by just removing various backup copies of Ditto and other snippet from my install;
                both Fasterfox and Firebug (Firefox extensions) report slightly faster rendering-times already; I definitely have to go over my own snippets and apply all the good coding practices described in the wiki article, in particular:


                • Snippets and plugins should not contain presentation layer code
                • Only configuration settings in snippet code, use php include to include logic code
                • Objectify Your Code

                moreover it is important to keep only those snippets, chunks & plugins that you actually use in your publicly-accessible pages;
                move all your tests and backups to a mirror install it’s pretty easy to go back and forth by FTP + MySQL exports/imports !

                PS: this should all go into a ’performance’ page in the wiki... maybe I’ll start it over the weekend.
                  ----------------------------------------------------------
                  http://www.linkedin.com/in/lucapost/
                  http://www.twitter.com/lukwe/
                  ----------------------------------------------------------