We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: BobRay at Nov 27, 2010, 09:46 PM

    Sorry, I’m not following. Doesn’t sendRedirect() initiate a new request cycle that would reload the cache (including the new doc) if it had been cleared?
    No, it tells the browser to initiate a new request cycle by sending a header and exit()’ing. The new request will know all about the newly cached aliasMap, but the point is, you’ll never be able to get the URL of the new page until you reach a new target via sendRedirect() (or reload all of the cache files manually before calling makeUrl()). This is the idea behind my landing page recommendation, which could be programmed to provide a link to the newly created Resource, maybe with some other details about the saved Resource.
      • 3749
      • 24,544 Posts
      Still not getting it. I save the new resource, get its resource ID, manually clear the cache, then call makeURL($id) and sendRedirect() to the new resource. I’m still not seeing why I would need a landing page that forwards to the new resource.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: BobRay at Nov 27, 2010, 10:03 PM

        Still not getting it. I save the new resource, get its resource ID, manually clear the cache, then call makeURL($id) and sendRedirect() to the new resource. I’m still not seeing why I would need a landing page that forwards to the new resource.
        Because clearing the cache does not load the fresh cache items into memory in the current request, so makeUrl() will not be able to get the proper URL from the aliasMap.
          • 3749
          • 24,544 Posts
          OK, but then how can it be working?

          And if I use a landing page, can I skip clearing the cache?
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 26903
            • 1,336 Posts
            This is the idea behind my landing page recommendation, which could be programmed to provide a link to the newly created Resource, maybe with some other details about the saved Resource

            Yes, like this, solves a few probs for me in this arae, definite addition to Frontpage 1.1
              Use MODx, or the cat gets it!