Purge disabled - Why cache deleted?

Hello.

Just out of curiosity: If I have enabled for all my feeds the “Cache media” and purging is completely disabled, why are files on the cache folder being deleted?

May 17 12:04:36 mydomain.com update_daemon2.php[759]: [10:04:36/16557] cache/images: removed 9 files.
May 17 12:20:46 mydomain.com update_daemon2.php[759]: [10:20:46/20126] cache/images: removed 2 files.
May 17 12:47:15 mydomain.com update_daemon2.php[759]: [10:47:15/25015] cache/images: removed 3 files.

Thanks!!

Cache management is separate from article purging. Cached files are retained for 7 days from the last time they were found in an article (multiple articles referencing the same image “reset” the countdown, so to speak).

The exception is starred articles which are cached separately and retained as long as the article is starred.

Understood.

Thanks!!


Edit.

Is it possible to consider adding in the future the possibility of modifying this behavior from the settings?

Thanks.

I think the challenge here is that images are just downloaded and used as needed. If different feeds used the same image it only gets stored once. So to have the cached images removed when an associated article is purged would require the code to be refactored (the cached starred images plugin actually does work like this). This makes sense because I find individual sites re-use the same images often, so it saves time and bandwidth by only downloading once (versus for every, individual article).

A configurable, global remove setting would actually be nice (maybe based on the default purge timeframe?), but I don’t know what fox’s vision for it is so…

(Certainly a plugin could be coded to do this, but it would obviously be duplicating a bunch of code I the core.)

Is it possible to consider adding in the future the possibility of modifying this behavior from the settings?

probably not, articles to images is a many-to-one relationship, might be shared between multiple feeds of multiple users on the system, etc. tt-rss is not designed to be an archive of the internet, news is ephemeral, so is the cache.

for those things you want to specifically keep there’s the cache starred plugin.

A configurable, global remove setting would actually be nice

it could be a config.php tunable i guess.

I was thinking in something like that, in a cache removal behaviour dependant on purge setting.

If I’ve disabled the purge, disabling the cache removal too.

Thanks @JustAMacUser.

If I’ve disabled the purge, disabling the cache removal too.

good luck with your data hoarding

There are weeks that I can’t read so many feeds. And I found that sometimes, a lot of my unread feeds have not cached images.

Edit:

Maybe, not removing the cached images for unread articles?

Maybe, not removing the cached images for unread articles?

that would require finding all articles that link to specific image URL (a hash of an URL, even, which is not reversible) and whether any of those are unread. i’ll let you figure out why this is not going to happen.

e: i’ve added a CACHE_MAX_DAYS tunable, i suggest you set to a reasonable amount (same with purging) instead of disabling both, unless your plan is to drown under an ocean of data.

THANK YOU @fox

I’m going to try.

Again though, caching media is done independently of articles (the exception being when using the cache starred images plugin, which has its own code to manage its own cache). The minute you start to associate media with a specific article means one of two things: Having to download multiple copies of the same image for each article, or having to track all of this in the database. It’s a lot of overhead for very little gain.

If it’s super important, just modify the number in the code.

e: Looks like fox already has it updated as a tunable, so there ya go. :slight_smile:

removed
sorry, I found the cause of this problem and it fixed.