Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add persistent disk-based cache support #73

Open
xxxserxxx opened this issue Oct 15, 2024 · 0 comments
Open

[Feature] Add persistent disk-based cache support #73

xxxserxxx opened this issue Oct 15, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@xxxserxxx
Copy link
Collaborator

c.f. #62, some devices (embedded, micro-computers) do not have large amount of memory to allocate to image caches, but may have access to persistent e.g. nvram space. This feature would add the option for users to enable disk-based cache.

A library that could be used for this is filecache.

Design topics

This feature should be optional, because using a file-based cache is likely to noticeably degrade scrolling performance -- loading images from disk is certain to be slower than pulling them from memory cache. Users will likely only want to use this feature in certain constrained cases. There is probably no advantage to enabling disk caching for any other reason, given that stmps is streaming megabytes of music data, and the tens of kilobytes of extra album art data is likely to be unnoticeable.

Special attention should be paid to cache invalidation. OpenSubsonic dictates no mechanism for detecting whether assets have changed on the server. This means there is no reliable cross-server way to determine if an asset has changed, which means the only way to check is to fetch the asset and compare it to what is cached. This will add significant overhead; the consequence of not doing this is that cover art can easily go stale. How do we handle this? Another hotkey for clearing the persistent cache? Automatically purging the disk cache when the application exits, to ensure asset correctness on next run?

Note that this last point is already an issue with the memory cache, with the exception that since it's a memory cache, clearing the cache is a matter of exiting the program. Extra attention will only be needed because disk caches are persistent across runs. The easiest solution would be to emulate the current in-memory behavior by purging the disk cache on application exit; in any case, a decision about behavior needs to be made.

@xxxserxxx xxxserxxx added this to the v1.1.0 milestone Oct 15, 2024
@xxxserxxx xxxserxxx added the enhancement New feature or request label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant