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

    The problem is that having all the pages cacheables, when I access to one of them, a few querys are generated to the database. This happens with every visit. The page is generated correctly in assets/cache directory.

    Web Server:

    * PHP 5.2.9
    * Apache 2.2
    * Ubuntu server

    Database:

    * MySQL 5.0.51
    * List of any tables over 1MB in size

    MODx:

    * 0.9.6.3

    Browser/Client:

    * Iceweasel 3.0.7
    * Debian Stable


    Thank you very much.
      • 7231
      • 4,205 Posts
      I think that there will always be some database activity regardless of the cache. The cahce will just keep it to a minimum.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 19904
        • 4 Posts
        Thans for reply.

        Every visit generates this query:

        64272 Connect xxxxx@localhost on
        64272 Init DB xxxxxx
        64272 Query SET CHARACTER SET utf8
        64272 Query SELECT DISTINCT sc.id, sc.menutitle, sc.pagetitle, sc.introtext, sc.menuindex, sc.published, sc.hidemenu, sc.parent, sc.isfolder, sc.description, sc.alias, sc.longtitle, sc.type,if(sc.type=’reference’,sc.content,’’) as content, sc.template, sc.link_attributes FROM `xxxxx`.`modx_site_content` sc LEFT JOIN `xxxxx`.`modx_document_groups` dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND (sc.privateweb=0) AND sc.hidemenu=0 AND sc.id IN (24,29,33,38,39,42,43,44,25,26,27,28,30,31,32,34,35,36,37,40,41) GROUP BY sc.id ORDER BY sc.menuindex ASC
        64272 Quit

        I think this is the minium access to database with cache. It’s right?
          • 22303 MODX Staff
          • 10,725 Posts
          The SET CHARACTER SET occurs on connection, but the other SQL query is from an uncached Wayfinder instance.
            • 19904
            • 4 Posts
            Thank you. I’ve cached WayFinder. Now, the mysql log shows:

            090414 13:51:35 70721 Connect xxxxx@localhost on
            70721 Init DB xxxxxx
            70721 Query SET CHARACTER SET utf8
            70721 Quit

            Can I avoid this connection?

              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: mmorata at Apr 14, 2009, 06:53 AM

              Can I avoid this connection?
              No, not with current releases of MODx. Revolution will feature connect on demand capability, but the default session handler that comes with it uses a mysql database table for session storage (thus the connection is always created unless you turn of the custom session handler or provide your own that does not depend on a database connection).
                • 19904
                • 4 Posts
                Thank you!