We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34183
    • 23 Posts
    I have a site where I am using phpthumbof and picturefill.js to generate responsive and retina ready images from template variables.

    The idea is that the user uploads only the largest image needed, then phpthumb generates all the smaller images for picturefill. Once the cache is created for all the images it works gangbusters, however, it takes a LONG time to create the cache on some pages.

    My issue is when someone enters content for a resource, then save with the "Empty Cache" checkbox enabled, it clears all of the site cache including my images, which then have to be regenerated.

    My question is if it's possible to selectively clear cache in a way that would not clear the phpthumb cache unless directly told to.

    Some ideas are:

    1. Figure out a way to remove phpthumb from the overall clear cache function and split it off into a "Clear phpthumb" type of thing.
    2. Create a plugin that clears the cache for only a specific resource when that resource is saved (would need to clear phpthumb cache if image tvs are used in the resource).

    Any other ideas that would work better? Any way to implement any of this?

    Thanks,
    Roger

    MODX 2.2.4-pl

    This question has been answered by multiple community members. See the first response.

    [ed. note: [email protected] last edited this post 13 years, 8 months ago.]
    • discuss.answer
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Disable the PhpthumbCacheManager plugin.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 34183
        • 23 Posts
        Awesome, thanks Mark, didn't know that was there! How does that effect new images being added to a resource via a template variable? I assume it will now just cache all new images and never delete cache without manually deleting via FTP.
        • discuss.answer
          • 9102 ☆ A M B ☆
          • 318 Posts
          Yes, exactly. I disable this plugin as well. The only caveat is that if you modify an image without changing the filename of the image, the thumbnail will not change. I'd say generally it's a good idea to change the filename of an image any time you change the image anyway, to avoid having the old version of the image stored in visitors' browser cache.

          Other than that it doesn't really matter whether the image is in a TV or just in a file or whatever. phpthumbof caches images according to their filename and the parameters of the call to phpthumbof.
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            Correct. The plugin basically empties the image cache on every cache clear, which can be useful if you upload new images with the same name during development. Disable it, and it doesn't clear the cache.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 34183
              • 23 Posts
              Great, thanks guys!
                • 28000 ☆ A M B ☆
                • 397 Posts
                HI Guys,

                I am having the opposite problem. Even though the PhpThumbManager plugin is active, upon using the empty cache function in the main MODX menu, the images are NOT being deleted in the cache folder.

                The folder has tons of images in it, and I was wondering what could be causing that?

                Cheers
                  Benjamin Davis: American web designer living in Munich, Germany and a MODX Ambassador. I am also co-founder of SEDA.digital, a MODX Agency.
                  • 37165
                  • 89 Posts
                  Where is the PhpthumbCacheManager plugin? I installed phpthubof but I don't see this anywhere?
                    • 46718
                    • 39 Posts
                    Quote from: rrswans at Mar 29, 2016, 10:24 PM
                    Where is the PhpthumbCacheManager plugin? I installed phpthubof but I don't see this anywhere?

                    Elements > Plugins