We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42618
    • 3 Posts
    Please can someone tell me if I should cache/uncache snippet calls for FormIt and GoogleSiteMap e.g. uncached: [[!GoogleSiteMap? &googleSchema=`http://www.sitemaps.org/schemas/sitemap/0.9`]] or cached: [[GoogleSiteMap? &googleSchema=`http://www.sitemaps.org/schemas/sitemap/0.9`]]

    I've read this but I still can't work it out: https://www.markhamstra.com/modx-blog/2011/10/caching-guidelines-for-modx-revolution/

    Thanks. [ed. note: elbafirst last edited this post 13 years, 7 months ago.]
      • 22303 MODX Staff
      • 10,725 Posts
      Caching is for things that only change between editing actions in the manager, i.e. when the site cache is refreshed. So GoogleSiteMap would be fine cached. But FormIt accepts user input, and thus, works with and responds with dynamic data in between editing actions in the manager. Thus, it would need to be called uncached.
        • 42562
        • 1,145 Posts
        Cached means the info produced or dealt with is not necessarily fresh and does not have to be. Old data is often retrieved or used to make the site fast. The data in this case is cleared and refreshed only when the Cache of the Site is cleared, but sometimes your script is not to wait for the Site's Cache to be cleared..and must be cleared immediately, or rather, never cached in the first place.

        FormIt is used in forms, and the data passed through has to be fresh at all times, and considered so by MODx. You don't want MODx caching the input of a visitor of two weeks ago and producing and showing you the same data now instead of the input of a brand new user.
        So call !FormIt uncached, alwaysQuote from: the-great-ONE
        Where there is no change (infrequent, uncritical) there is cache
        Where there is change (frequent, instant or important) there is no cache!

        If you don't clear your Site's Cache regularly, and certain changes occur which you wish to be reflected in the Sitemap....call it uncached.

        If it ain't critical, better GoogleSiteMap cached so it will more quickly load, as the page grows with billions of links in it.
          TinymceWrapper: Complete back/frontend content solution.
          Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
          5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
          • 42618
          • 3 Posts
          Wow! Awesome and swift replies. Many thanks.