We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 577
    • 132 Posts
    Anyone have #modx revo running cache.xPDOMemCache through Sessions. I have resources caching but want sessions caching too. All settings set.

    In looking at "modSessionHandler" it appears that it is only for the DB, however the system_settings lead me to believe it can be cached.

    What am I missing here?
      "One of these days I will get around to my own website... Its only been about 12 years... maybe tomorrow smiley"
      • 577
      • 132 Posts
      Anyone?
        "One of these days I will get around to my own website... Its only been about 12 years... maybe tomorrow smiley"
        • 22303 MODX Staff
        • 10,725 Posts
        The cache_db setting must be turned on in order for the cache_db_sessions setting to have any affect. By default, sessions are not cached like normal db objects are when cache_db is enabled. But this is limited caching based on your other session settings.

        Are you wanting to cache the session db objects or are you really looking for a memcached based session handler? I suspect the latter, in which case you can configure that at the php level and then disable the default MODX database session handler by setting the session_handler_class System Setting to an empty string.
          • 577
          • 132 Posts
          Yes the latter, however my understanding is that the best solution is not to eliminate the DB completely by handling it through the PHP layer. I had assumed it may have been handled similar to the documentation at the attached link. Here the session is handle similar to the way modx already handles resource cache and always having the DB to fall back on.

          Overall this is all pretty new to me and getting out my my current comfort zone, so in no way and I trying to assume I know what is correct. Just sharing what I am learning and understanding.

          Thank you for your time and would like your inout on the attached logic when you have a moment to reply

          http://orig.keboola.com/blog/php-sessions-with-memcached-and-a-database-session-in-the-cloud-done-right/
            "One of these days I will get around to my own website... Its only been about 12 years... maybe tomorrow smiley"
            • 22303 MODX Staff
            • 10,725 Posts
            Then you do want the former, and it does work similar to the one at that link, but I believe it will only work if you use cache_db globally. Perhaps a feature request to separate (and possibly improve) the behavior would be in order.

            Thanks for the link btw. Interesting post and solution.