We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38462
    • 39 Posts
    I currently host various site within MODXcloud, that seem to experience some sort of cache issue?

    A resource within the site will load instantly (500ms) after the first visit. However, every so often various resources will again load very slow (3 - 5 seconds), as if the resource cache has been cleared. All resources should constantly load fast once they have been cached, right?

    I first thought it was the MODXcloud's rolling backup that was clearing the cache, although now it's more ofter than every 24hrs.

    I've added [^t^] [^s^] to the header of each resource to check total load time and source for each resource.

    <meta name="load" content="Query Time: 0.0005 s Request: 1 PHP Exec: 0.0548 s Total time: 0.0553 s Source: cache">


    Total load time stays almost the same whether the resources load fast or slow! Also the source always states it's from the cache, unless I clear the cache manually.

    I've enabled database cache and database session cache. I've also installed cachemaster extra.

    I also use MaxCDN Toolkit extra, however, this issue was evident before I installed MaxCDN.

    Any ideas what I may be doing wrong or what could be causing this issue.
      • 38462
      • 39 Posts
      I have have found the cause of the issue.
      All resources using a template and static resource with the extra TwitterX installed.

      This is my TwitterX call (consumer key, secret and token info removed):
      [[!TwitterX?
                                  &twitter_consumer_key=`xxxx`
                                  &twitter_consumer_secret=`xxxx`
                                  &twitter_access_token=`xxxx`
                                  &twitter_access_token_secret=`xxxx`
                                  &limit=`1`
                                  &timeline=`user_timeline`
                                  &chunk=`tweet_chunk`
                                  &cache=`7200`
                                  &screen_name=`zapmedia`
                                  &include_rts=`0` ]]
      


      Cache set at 7200 is inline with cache clearing issues / slowness that the site was experiencing?
      After removing TwitterX all resources load instantly.

      Should TwitterX be called cached or uncached?

        • 24168
        • 45 Posts
        TwitterX uses the MODX cache for speed so can be called cached or uncached. Only need to use Un cached if you are using the output filter :ago or similar on the date.

        One thing to note is that you can try specify a cache_id which might help as otherwise TwitterX tries a generic cache filename.

        Try adding cache_id='SOMETHINGUNIQUE'
          Stewart
          Freelance Web Designer & Developer:
          http://www.qodo.co.uk

          My extras:
          TwitterX http://modx.com/extras/package/twitterx
          TableOfContentsX http://modx.com/extras/package/tableofcontentsx