[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
- Possible FRA servers down
Is it possible that the Frankfurt servers are currently down? There is no way to fetch any data. Given the few reports already in the <#564160731327758346> chat...
- Compatibility issue with Kakao OpenID Co...
**Context:** I am attempting to integrate **Kakao Login** (one of the largest social login providers in South Korea) into my Flutter application using Appwrite'...
- Framework categorization for Sites
Hello, I want to deploy my web app via Appwrite SItes. My web app is vite+reactjs. In the Appwrite docs, it creates a vite+react app, and chooses React from the...