We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36931
    • 206 Posts
    Hello
    I create a snippets which will check if an image exists on a folder.
    I also have a different page, from which I can add a image or delete.

    When I visit my web page it displays the image. But when I delete that image, MODx keep in this cache the image and then I have error image becaise the src="" can not find it.

    After saving my snippests, I discovered that the error disappear, and I also notice when I uncheck the option "delete the cache, when saving", of my snippests, the proble remind,

    Then, I deducted that there is a caching problem.

    Is there a way to clear the cache, throuh my snippsts when the image is not found?

    Many thank for your help
      • 22303 MODX Staff
      • 10,725 Posts
      Don't cache your Snippet that checks for the existence of and renders the img src.
        • 36931
        • 206 Posts
        Snippets and the MODx Cache

        If a document is cacheable then the snippets on that document need to be called as unchacheable [! ]. [ed. note: pierrot1010 last edited this post 14 years, 10 months ago.]
          • 22303 MODX Staff
          • 10,725 Posts
          Was that a follow-up question? FWIW, the link you posted is only valid for MODX Evolution (0.9.x/1.x releases).
            • 36931
            • 206 Posts
            Oups, then forgive me.
            But I called my snippets list this and it works

            [[!mySnippets? &page=3]]

            I add a ! after [[