Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Ignored cleaning cache folder #9

Open
koentjeh opened this issue Mar 9, 2021 · 0 comments
Open

Ignored cleaning cache folder #9

koentjeh opened this issue Mar 9, 2021 · 0 comments

Comments

@koentjeh
Copy link

koentjeh commented Mar 9, 2021

Hi,

Is there a reason to skip the cache folder while removing missing images?

// Cached path guard
if ($this->isInCachePath($file)) {
  continue;
}

Thanks to this module we've managed to reduce the size of the media folder from 160GB to 149GB. It's a good start but I believe the missing images will still occur in the cache folder after a catalog:image:resize.

We used a bash script to remove the images from the cache folder without noticeable result on the storefront. (lost the result of the reduced size).

#!/bin/bash

echo "Start!"
while read image; do
  echo "found $image in .txt"
  for file in $(find pub/media/catalog/product/cache/ -path "*$image");
    do
      rm $file;
      echo "removed ${file} from filesystem";
    done;
done <removed_images.txt
echo "Done!"

Would love to hear a response if you would consider implementing this feature or not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant