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

Answered Cache MODX REVO

    • 49359
    • 16 Posts
    Hi All. Help !!! Here are my settings caching. When I press F5 clamp the processor server to boot up to 100% at a time when I try this on site http://modx.com/ this page just updated and all looks like simple HTML page. And i have TTFB ~ more than 0.3 sec.(google recomendation less than 0.2s)



    There are some information about request:
    0.0002 s - time database queries

    1 - database queries

    0.1607 s - time working PHP scripts

    0.1609 s - the total time to generate the page

    cache - content source (database or cache)



    How to improve PHP scripts speed and TTFB?
    THX!

    This question has been answered by mdehaan. See the first response.

    • discuss.answer
      • 37914
      • 89 Posts
      Disabling database cache could speed up PHP.
      This shouldn't be enabled for small websites...


      Database caching
      If you enable the cache_db system setting, MODX can automatically cache database result sets fetched by any xPDOCriteria or xPDOQuery instance. This includes all of the result sets representing xPDOObjects or collections of xPDOObjects returned by methods like getObject and getCollection.

      This feature can be enabled in environments where database access is more expensive than PHP include time, for instance, when using an external database server, or custom configured for environments with memcached, APC, or other caching systems available. This is a separate partition from the other cache partitions in MODX, so it can be configured with other cache handlers. See xPDO Caching for additional information.
      [ed. note: mdehaan last edited this post 11 years, 3 months ago.]
        • 3749
        • 24,544 Posts
        These suggestions will speed things up:

        Replace conditional output modifiers with dedicated snippets.

        Replace getResources and Wayfinder with pdoResources and pdoMenu from the pdoTools package. Other items in the package are also faster (e.g., pdoUsers).

        Don't use TVs for searching and sorting.

        Make your images smaller when possible and use CSS sprites.

        Combine CSS and JS files manually and load a single one of each when possible.

        Don't nest things any more than necessary: http://bobsguides.com/blog.html/2014/05/15/dont-be-a-nester/.

        Make as many pages as possible cacheable and don't call snippets uncached unless necessary. Menu snippets (e.g., Wayfinder and pdoMenu) should generally be called cached.
          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
          • 49359
          • 16 Posts
          Quote from: BobRay at Jul 04, 2015, 06:35 PM
          These suggestions will speed things up:

          Replace conditional output modifiers with dedicated snippets.

          Replace getResources and Wayfinder with pdoResources and pdoMenu from the pdoTools package. Other items in the package are also faster (e.g., pdoUsers).

          Don't use TVs for searching and sorting.

          Make your images smaller when possible and use CSS sprites.

          Combine CSS and JS files manually and load a single one of each when possible.

          Don't nest things any more than necessary: http://bobsguides.com/blog.html/2014/05/15/dont-be-a-nester/.

          Make as many pages as possible cacheable and don't call snippets uncached unless necessary. Menu snippets (e.g., Wayfinder and pdoMenu) should generally be called cached.

          THN, but I did it all. It did not help. DDOS lays down site and MySQL
            • 3749
            • 24,544 Posts
            That suggests that your server is overloaded and/or your host doesn't have very good DDOS defenses.
              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
              • 49359
              • 16 Posts
              Quote from: mdehaan at Jul 04, 2015, 08:09 AM
              Disabling database cache could speed up PHP.
              This shouldn't be enabled for small websites...


              Database caching
              If you enable the cache_db system setting, MODX can automatically cache database result sets fetched by any xPDOCriteria or xPDOQuery instance. This includes all of the result sets representing xPDOObjects or collections of xPDOObjects returned by methods like getObject and getCollection.

              This feature can be enabled in environments where database access is more expensive than PHP include time, for instance, when using an external database server, or custom configured for environments with memcached, APC, or other caching systems available. This is a separate partition from the other cache partitions in MODX, so it can be configured with other cache handlers. See xPDO Caching for additional information.
              THX!
                • 49359
                • 16 Posts
                Quote from: BobRay at Jul 08, 2015, 12:13 AM
                That suggests that your server is overloaded and/or your host doesn't have very good DDOS defenses.
                THX Bob!