We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9648 ☆ A M B ☆
    • 91 Posts
    I think in generation contexts-settings cache has problem: when refreshing all site cache, not using context setting, but using system settings.
    This is original method: https://gist.github.com/4448579
    This is modified: https://gist.github.com/4448846
    DIFF view: https://gist.github.com/4449531/revisions [ed. note: Fi1osof last edited this post 13 years, 9 months ago.]
      MODX Revolution expert
      Follow ME on Twitter | Feel free ask any question on MODX-club
      • 25663 MODX Staff
      • 12,272 Posts
      Can you elaborate on what the cache problem is, and how the proposed changes improve that? From what I understand, the transient contexts are internal tools that were not intended to be used like system settings for some very specific reasons (which someone from the core coding team will need to elaborate upon).
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 9648 ☆ A M B ☆
        • 91 Posts
        Quote from: rethrash at Jan 03, 2013, 09:51 PM
        Can you elaborate on what the cache problem is, and how the proposed changes improve that? From what I understand, the transient contexts are internal tools that were not intended to be used like system settings for some very specific reasons (which someone from the core coding team will need to elaborate upon).
        Sample: we have 3 contexts. For two of them we create settings transient_context=true, and for one transient_context=false. When we refresh site cache, this setting will not matter. For all of this contexts cache will be create with resourceMAp and etc.
        And if we set system setting transient_context=true, all contexts will be skipped (and in this case backend will be broken).
          MODX Revolution expert
          Follow ME on Twitter | Feel free ask any question on MODX-club
          • 9648 ☆ A M B ☆
          • 91 Posts
          In the 2.3.0 dev codebase, there is a difference in how the caches are generated.

          In modContext::prepare():
          foreach ($partOptions['contexts'] as $context) {
              $contextResults[$context] = ($this->generateContext($context) ? true : false);
          }

          Here not exists second param $options with context settins.

          In modContext::prepare():
           $context = $this->xpdo->cacheManager->generateContext($this->get('key'), $options);


          This $options metter only when cache files removed manualy (via FTP for example) and we initialize like this:
          $modx->initialize('foo', $options);
            MODX Revolution expert
            Follow ME on Twitter | Feel free ask any question on MODX-club