We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26903
    • 1,336 Posts
    Ok, what’s the value of the system setting named ’server_offset_time’?
      Use MODx, or the cat gets it!
      • 6063
      • 15 Posts
      the value of server_offset_time is 0
        • 26903
        • 1,336 Posts
        Ok, in your /core/cache directory there should be a file called sitePublishing.idx.php containing a variable named $cacheRefreshTime, what is its value?
          Use MODx, or the cat gets it!
          • 6063
          • 15 Posts
          <?php $cacheRefreshTime=1282067040;


          by the way; shouldn’t there be a php closing tag like ?>
            • 26903
            • 1,336 Posts
            In my setup the value of this is 0, manually edit the file to set this to 0, preserving the original value in case you need to revert, and try your tests again, it looks as though this value is greater than time now, so your publish/unpublish check is not being invoked.

            If your file just contains php code and not a php/html mix you can omit the closing tags, this prevents the parsing of extra whitespace and the introduction of some weird errors, end of file will do the job.
            It’s very common not to close tags in php files, look at any of the php files in your revo install.
              Use MODx, or the cat gets it!
              • 6063
              • 15 Posts
              Hello again
              I tried setting the cacheRefreshTime to 0, but it seems nothing is happening.

              I noticed that when clearing the cache manually with an upcoming publish or unpublish event, a new value similar to 1282117080 is inserted in $cacheRefreshTime=

              If no publish/unpublish events are planned the value is 0 in $cacheRefreshTime.

              I guess that 1282117080 is the specific time where modx should clear its cache. How to analyse this timecode?
                • 26903
                • 1,336 Posts
                Use this link, http://www.onlineconversion.com/unix_time.htm, one of many, in this case its giving ’Wed, 18 Aug 2010 07:38:00 GMT’.
                  Use MODx, or the cat gets it!
                  • 6063
                  • 15 Posts
                  okay, then it makes all kind of sense now.

                  The "refresh cache time" is obviously set 2 hours back in time and therefore the site will not refresh. Im in Denmark 1 hour ahead of GMT and 1 ekstra hour i guess because of summertime??

                  In modx system info my server and local time is correct.

                    • 26903
                    • 1,336 Posts
                    OK remember the previous post about this system setting ’server_offset_time’, you can change this to offset your servers time from GMT, this setting is added to timenow in the checking code :-
                     $timeNow= time() + $this->modx->getOption('server_offset_time',null,0);

                    so you can adjust this back and forth as you wish, so set this to -2? I’ve never really used this as I’m on GMT but you should get somewhere by playing with it.
                      Use MODx, or the cat gets it!
                      • 6063
                      • 15 Posts
                      ok, thanks I will try it:)