Cache_starred_images - Removal of cached files

Hi all

i tried searching in the forum, but could not find anything related, besides this

cache_starred_images is enabled. Yesterday I unstarred all the articles I had. I expected that /cache/starred-images and /cache/starred-images.status-files would have been empty by now, but those still contain files.

I run both php update.php --feeds --force-refetch, update.php --feeds --force-update and update.php --feeds --force-rehash, which returned expiring cache/starred-images and cache/starred-images.status-files... but it does not seems it did the trick.

There is nothing related in the logs.

Is there a lag or am I missing something?

Let me know if you need additional information

Thanks in advance.

P.S.: PHP 8.1.8, 10.3.35-MariaDB, shared hosting

i think those should be cleaned with the housekeeping hook, i don’t remember if it is being invoked with update.php --feeds, you might need to run this separately (–help).

the plugin might, of course, be broken. :slight_smile:

I tried testing further. There was a starred article, for which there was an image in the /cache/starred-images directory.

I unstarred it and run update.php --feeds. Below is the output:

[rss]$ php update.php --feeds
[16:25:44/2550] Lock: update.lock
[16:25:44/2550] Scheduled 2 feeds to update…
[16:25:44/2550] Base feed: https://xxx
[16:25:44/2550] => Xxx (ID: 264, U: dario [2]), last updated: 2022-07-25 14:30:03
[16:25:44/2560] Lock: update_daemon-feed-264.lock
[16:25:45/2550] <= 1.4708 (sec) exit code: 0
[16:25:45/2550] Base feed: Tiny Tiny RSS: Community - Latest posts
[16:25:45/2550] => Tiny Tiny RSS: Forum (ID: 213, U: dario [2]), last updated: 2022-07-25 14:30:05
[16:25:45/2828] Lock: update_daemon-feed-213.lock
[16:25:47/2550] <= 1.4587 (sec) exit code: 0
[16:25:47/2550] Processed 2 feeds in 2.9312 (sec), 1.4656 (sec/feed avg)
[16:25:47/2550] Running housekeeping tasks for user 2…
[16:25:47/2550] caching media of starred articles for user 2…
[16:25:47/2550] expiring cache/starred-images and cache/starred-images.status-files…
[16:25:47/2550] Sending digests, batch of max 15 users, headline limit = 1000
[16:25:47/2550] All done.
[16:25:47/2550] Expired cache/export: removed 0 files.
[16:25:47/2550] Expired cache/feeds: removed 0 files.
[16:25:47/2550] Expired cache/images: removed 0 files.
[16:25:47/2550] Expired cache/upload: removed 0 files.
[16:25:47/2550] Removed 1 old lock files.
[16:25:47/2550] Removing old error log entries…
[16:25:48/2550] Purged 0 orphaned posts.
[16:25:48/2550] caching media of starred articles for user 0…
[16:25:48/2550] expiring cache/starred-images and cache/starred-images.status-files…

edit for clarification: The image was NOT deleted

The feed containing the “no longer starred article” was not within the update interval, but it is not clear if the housekeeping would delete the cached files nonetheless.

I also tried “Debug feed” from the browser, but that doesn’t not seems to trigger any housekeeping.

What is odd, is that the plugin works perfectly in caching the images. It seems to fail in deleting them.

i’ve run this through the debugger and it seems that cached files are deleted when the article no longer exists in the database (i.e. it is purged).

i don’t remember why this is implemented this way, my guess would be i thought that keeping some files on disk a bit longer is better than downloading everything again if you accidentally unstar something or w/e.

Thanks for looking into it.

So just to be sure I get it, if I have purging set at 7 days, and there are no more starred articles, the cache directory should be emptied after one week?
Unless of course the original feed still has the articles, which means the original article is not purged, therefore cached files will not be deleted, right?

That would explain my original impression of the directories full of files despite the fact I had no more starred articles.

Again, thanks a lot.

yeah, you got this right, that’s how this should work.