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

Persistent cache is not working #101

Closed
Krobys opened this issue Apr 2, 2024 · 2 comments
Closed

Persistent cache is not working #101

Krobys opened this issue Apr 2, 2024 · 2 comments

Comments

@Krobys
Copy link

Krobys commented Apr 2, 2024

Please tell me how to make the memory cache work. After closing the application and opening it again, pictures are not loaded when the Internet is off.

I have tried all settings, both standard KamelImage and using my own KamelConfig. No matter how hard I tried, the maximum I achieved was that the cache works in short memory, but not in persistent memory.

Ktor version 2.3.9, engines okhttp, darwin
Version kamel 0.9.4

Could you give me a working example of how to make persistent cache work, because those examples I found do not work if you close the application, turn off the internet and open the application again (on any platform, be it ios android).

@luca992
Copy link
Member

luca992 commented Apr 2, 2024

The memory cache is expected to be empty after restarting an app. Do you mean the disk cache?

Here is how you can configure the disk cache:
https://github.com/Kamel-Media/Kamel?tab=readme-ov-file#disk-cache-size-in-bytes

By default it only persists 10 mib of image data, but you can increase that to how ever large you would like.

@luca992 luca992 closed this as completed May 3, 2024
@luca992
Copy link
Member

luca992 commented May 16, 2024

I looked into this more. The diskcache is working while online, but ktor throws an error preventing it from loading data from the DataCache when offline on native & jvm targets. Android is working

#104

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

No branches or pull requests

2 participants