"Clear album image cache"

When using the plugin cacheManager, clicking on the button "Clear album image cache" in an album will only "_40_cw40_ch40_thumb.jpg", "_200_thumb.jpg" (thumbnails) and "_600.jpg" (resize) images from the cache deleted, but not the "_80_cw80_ch80_thumb.jpg" images.

Comments

  • acrylian Administrator

    That actually clears the whole album cache and makes no difference between sizes. Any errors? If you or anyone else visited the album before you looked at the cache again the image could have been just recreated.

  • wibbi Member
    edited March 15

    I'm the only one and I'm not leaving the site after clicking on the button "Clear album image cache".

    The debug.log:

    99 Warnings after clicking on the button "Clear album image cache".
    33 images in the album.

      WARNING: Cannot modify header information - headers already sent by (output started at /var/www/virtual/user/html/zp-core/admin-functions.php:4172) in /var/www/virtual/user/html/zp-core/i.php on line 194
      header called from include (i.php [194])
        from getImageURI (functions-basic.php [968])
          from Image->getCustomImage (class-image.php [1000])
            from getAdminThumb (admin-functions.php [4631])
              from printAlbumEditForm (admin-functions.php [1679])
                from admin-edit.php [693]
    {20701:Thu, 15 Mar 2018 15:55:25 GMT}
      WARNING: Cannot modify header information - headers already sent by (output started at /var/www/virtual/user/html/zp-core/admin-functions.php:4172) in /var/www/virtual/user/html/zp-core/i.php on line 195
      header called from include (i.php [195])
        from getImageURI (functions-basic.php [968])
          from Image->getCustomImage (class-image.php [1000])
            from getAdminThumb (admin-functions.php [4631])
              from printAlbumEditForm (admin-functions.php [1679])
                from admin-edit.php [693]
    {20701:Thu, 15 Mar 2018 15:55:25 GMT}
      WARNING: Cannot modify header information - headers already sent by (output started at /var/www/virtual/user/html/zp-core/admin-functions.php:4172) in /var/www/virtual/user/html/zp-core/i.php on line 196
      header called from include (i.php [196])
        from getImageURI (functions-basic.php [968])
          from Image->getCustomImage (class-image.php [1000])
            from getAdminThumb (admin-functions.php [4631])
              from printAlbumEditForm (admin-functions.php [1679])
                from admin-edit.php [693]
  • acrylian Administrator

    Perhaps related to your custom changes. Please try the original code to sort that out.

  • wibbi Member

    I have now replaced all files with core hacks with untouched originals and still they are not deleted the "_80_cw80_ch80_thumb.jpg", all others already. I even deleted all images manually, then they were recreated. But the "_80_cw80_ch80_thumb.jpg" were not deleted again.

  • I think (but not sure) that these cache images are recreated when admin page is reloaded.

    to be sure: when you are on page album, and before delete cache images for this album, manually delete some "_80_cw80_ch80_thumb.jpg" and other "_80_cw80_ch80_thumb.jpg" with "_80_cw80_ch80_thumb.old.jpg" (it avoid to rename all :-) )
    then delete your cache
    if I am right, ALL your album cache is deleted (included "_80_cw80_ch80_thumb.old.jpg" and then some (or all) "_80_cw80_ch80_thumb.jpg" are recreated because adin edit need for them

  • acrylian Administrator
    edited March 15

    What Vincent says ;-)

  • wibbi Member
    edited March 15

    Muahaha, yes! Thats right. Thanks vincent!

    Question: I don't understand why is $cachefolder = NULL?

     static function clearCache($cachefolder = NULL) {
            if (is_null($cachefolder)) {
                $cachefolder = SERVERCACHE;
            }
            zpFunctions::removeDir($cachefolder, true);
        }
  • acrylian Administrator
    edited March 15

    Its a general function for all caches. We have several, so it is for the actual folder to clear. There are two cache types as noted on the user guide

    • /cache the image cache
    • / cache_html/ for statically cached HTML pages using the static_html_cache plugin. This has sub folders for album, image, Zenpage pages, Zenpage news, rss feeds and sitemaps by some plugins (plugins can naturally use it to add further ones).
  • wibbi Member

    The function as function, yes. I mean the $cachefolder = NULL?
    Why is set the variable $cachefolder to NULL as the start of the function? I don't understand this. Then $cachefolder is everywhere NULL?

    
    function foo($foo = NULL) {
    var_dump($foo ); // NULL
    }
    
  • acrylian Administrator

    if (is_null($cachefolder)) { $cachefolder = SERVERCACHE; }
    = image cache clearance

  • wibbi Member

    if (is_null is something free of sense.

  • acrylian Administrator
    edited March 15

    If not set specifially use the main default cache makes a lot sense to me…

Sign In or Register to comment.