2024-03-27, 11:12 AM
(This post was last modified: 2024-03-27, 11:25 AM by Efficient_Good_5784. Edited 4 times in total.)
(2024-03-27, 09:17 AM)ric Wrote: The other thing i would say is that if there is every a need for a cache directory then I think in most cases it would make sense to put it on the largest drive (of course the perfect solution would be a ram disk if you have the space).Can you explain your reasoning for this statement?
I may be missing or don't know something, but why does it have to be on the largest drive? Were you referring to the fastest drive?
Obviously you need a drive with enough space to hold the amount of cache that will be generated within a given time frame, but I've been thinking about this and don't see why it needs to be on the largest drive on a system.
(2024-03-27, 09:17 AM)ric Wrote: if jellyfin removes its cache files then why is it set to remove everything.One of the points presented in this thread on why OP lost his media is because they possibly told Jellyfin that their media folder(s) were cache folders.
Cache is considered safe to destroy as long as the original files the cache was derived from still exist. You can always recreate it.
Jellyfin expects to start on an empty cache folder and build it for itself. As in, it expects its cache folder to be exclusively for itself to use and no one else.
So since Jellyfin has that expectation, it modifies/deletes all the files in the cache folder path as it pleases because it has no reason to doubt that others are using it.
The cache folder grows slowly holding images and metadata that each client opens in the server. The idea being that if an item was recently used, maybe other clients will use it in the near future, so it will have it cached to serve it faster in the future.
In the dashboard, there's a task set by default to clean the cache directory.
It's important to regularly clean out the cache directory because you don't want old cached data that doesn't get used anymore to take up space. You also might have cached something that no longer exists in the server, so it makes sense to delete that too.
One of the things it looks out for to clean is folders and files that doesn't make sense to how it normally creates cached items. Again, it does this because it expects that the directory was created by itself and that the important data lives elsewhere.
Same thing with the transcode directory. It regularly cleans this directory out since transcodes can be remade again.
Basically, just don't link either the cache or transcode folder to important directories on your system and you'll avoid issues.
(2024-03-27, 09:17 AM)ric Wrote: surely from a neat coding POV it should just remove all cache 'pattern' files not just *.*Have you seen what the cache folder looks like?
If you run a Jellyfin server, go and look at it. Open it up in a file browser or a system shell.
You'll see that all the cache items that Jellyfin creates have seemingly random names. All the cache files don't share a pattern to distinguish them as cache files.
The only distinguishing characteristic is that they all reside in the cache folder.