We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5430
    • 247 Posts
    Quote from: juliehoy at Aug 08, 2016, 11:16 PM
    How does all this db retrieval affect page loading speed?

    Do the number of plugins/chunks/snippets/etc slow things down? As in, it would be better to keep the number of chunks to a minimum and keep as much as possible in the template, vs chunking as much as possible?

    No, not if you leave everything cached. MODX will build a fully cached version of the entire page output that is vended much like static HTML. So as long as you keep uncached elements to a minimum, speed isn't an issue. If it's a complex page, it may load slowly the first time after cache is cleared, but after that it's very close to static HTML in speed.

    The tagging syntax allows things to be called cached or uncached (i.e. [[snippetname? &parameters=`setting`]] is a cached, insert an exclamation point to serve the result uncached: [[!snippetname? &parameters=`setting`]]). Everything is cached by default, but if you have a dynamic element that needs to respond to a GET array, or some other user input, you can call it uncached to be sure it loads fresh everytime.

    I'd strongly recommend looking at MODXCloud https://modxcloud.com/ for hosting/experimenting. It's just so good, and makes working with MODX a dream.
      • 52609
      • 32 Posts
      Thanks Clayton, good info to know.

      I'll keep MODXCloud in mind. Right now I'm trying FastComet and very pleased so far.

      Why does this forum load so incredibly slowly?
        • 52609
        • 32 Posts
        Quote from: juliehoy at Aug 09, 2016, 01:55 AM


        Why does this forum load so incredibly slowly?


        I just timed it -- it took 22 seconds to post that last comment!!
          • 3749
          • 24,544 Posts
          I do try to put as much as I can in the Template rather than in a chunk. First, it reduces issues with elements in the chunk being cached or not. Second, it speeds up page loads for people who arrive at the site after the cache has been cleared (which happens often when you are working on the site).

            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
            • 52609
            • 32 Posts
            Thanks!

            Would you recommend MODX for app development?
              • 3749
              • 24,544 Posts
              Yes, definitely. smiley

              You can create resources with no template (empty template), and just put a snippet on the page that reads the $_POST or $_GET array and returns the appropriate response. This assumes that you can write PHP code for the snippets, but it's going to be very difficult to create an app without that skill.
                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
                • 52609
                • 32 Posts
                Great! That sounds like another really good reason for using the db system? Ease of creating an app that goes along with a website (as opposed to or in addition to a mobile accessible website).

                Can you point me in the direction of some example apps that have used MODX?

                Thanks!
                  • 3749
                  • 24,544 Posts
                  I can't, but maybe someone else here can.

                    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