[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
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...
- How do you contact support to cancel a s...
My nephew signed up with my CC without my permission and has forgotten the password to the account. I can't for the life of me get a hold of anyone at appwrite....
- Local appwrite run functions --user-id n...
Hi, I'm running into an issue when testing Appwrite functions locally with user impersonation. I'm using a self-hosted Appwrite instance and running functions ...