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

    I have a problem with caching - I am trying to set up some simple blogging on a site and everything is working except that modx seems to be caching the blog page. I am making an uncached call to Ditto and caching is disabled on the blog page, but new blog posts still don’t show up until I clear the cache in modx. I have the NewsPublisher call in a different page outside the main blog page in the tree - I thought this might make a difference but it doesn’t seem to.

    Here is my blog page code:
    [!Ditto? &startID=`2` &summarize=`3` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags`!]
    
    Showing [+start+] - [+stop+] of [+total+] Articles
    
    [+previous+] [+pages+] [+next+]
     
    [[Reflect? &dittoSnippetParameters=`startID:2` &groupByYears=`0` &showItems=0` &tplMonth=`reflect_month_tpl`]]


    What could possibly be going wrong?

    Thanks
    • If you’re using Newspublisher to publish the articles, then I think there is a &clearcache snippet parameter to make Newspublisher clear the cache once the document has been created.
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 31904
        • 8 Posts
        Thank you very much, this has solved the problem.
        • I might just add that calling Ditto uncached on a live site is asking for problems. Ditto is fairly efficient, but since new pages require the cache to be regenerated anyway, I do not see a benefit in having uncached Ditto calls anywhere in my sites. This way, the only time Ditto is required to query the database and process all the information it needs to in order to render the content is just once after the cache is cleared. This of course, will not work with Ditto’s internal paging features, but for calls that do not incorporate paging, this is one of my general rules.