[Question] will there be a way for the SDK to manage and cache queries in the future?
- 0
- Databases
- Flutter
- General
- Self Hosted

if not does anybody know how a cache system should be structured, im assuming when i do the query calls i need to save the results by document id and whenever i query to check wether it has been called within a certain time limit?

Caching server-sided or client-sided?

Client sided ofcourse

Not sure, but I think it's better to make that be handled by the user instead of the SDK. However this is a bit similar to offline support. Currently there is a repo in beta for flutter Offline support, maybe it has what you want

Since basically offline support is pretty similar to caching client sided 😅

i know there is one for firebase but it does not support DocumentList types


But from what I'm seeing it gets everything by default so it only uses cache when network isn't available

The "Issue" is that you don't/can't know if something got or not updated

well they could check these documents with realtime subscription?

I think not, since when something changes, the app could be in the background and not receive the changes through realtime

oh i see

A workaround I recommend is saving things locally and then creating a doc called updated, for example. That doc has an integer attribute (for example, 0). Once you create a new document, you increase that number by 1. Once the app is opened, you check if that value has increased respect the saved (if so, you update since there's a new document that has been added), and if it's the same, you don't need to get anything (so you use cached elements)

The issue would be if some document get's updated or deleted instead of added

Then you will need to have a different attrubute and if there is a delete or update, get again all documents

how would i know what gets deleted or updated id have to do realtime checks again

and that for each document?

oh nvm

yeah thats the same issue with offline support
Recommended threads
- I am facing this error: type 'Null' is ...
When attempting to fetch areas from the area collection, the application throws an error: "type 'Null' is not a subtype of type 'int.'" This issue originates in...
- Adding Domain to Sites [Self Hosted]
I am struggling to get this working. I stood-up a new server and deployed appwrite 1.7.4. I added update .env file _APP_DOMAIN=appwrite.mydomain.com _APP_DOMAI...
- Need help migrating from self hosted to ...
Hi! I am using self hosted appwrite for testing stuff out and now it's prod ready I want to deplot it to the cloud version. It gave me this error when fetchin...
