[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
- Account Status
Hello! I'm a student and am in the GitHub Student Organization, and according to GitHub, I am recieving pro membership via the Student Dev Pack. However, when I...
- Refund Request - Just purchased 2 mins a...
Hello Appwrite Team! I am a student and like 2 minutes ago I purchased Appwrite Pro ($15) because I had reached a limit on the number of attributes in a collect...
- Seed db
hello there... is this correct way to seed appwrite