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

Cache not working? #95

Open
Bucky420 opened this issue Aug 13, 2024 · 2 comments
Open

Cache not working? #95

Bucky420 opened this issue Aug 13, 2024 · 2 comments
Labels
enhancement New feature or request low priority

Comments

@Bucky420
Copy link

Bucky420 commented Aug 13, 2024

not shure if im doing it wrong but the settings should be set right 60 seconds?

i get this in console

Couldn't verify username because servers are unavailable
every thing else works fine just would be nice to allow people to login even if auth servers are down for a few hours

@evan-goode
Copy link
Member

Currently the cache just acts as a "cushion" so if Drasl wants to make many requests within a short period for the same resource on a FallbackAPIServer, it will re-used the cached response from the fallback server instead of spamming it. After CacheTTLSec seconds elapse after something enters the cache, it gets evicted.

So it sounds like it might be working as intended, but you're right, it would be nice if the cache could also be used if the remote resource is temporarily inaccessible. To do so we'd need to handle each item's TTL ourselves and use https://github.com/dgraph-io/ristretto/blob/v0.1.1/cache.go#L248 instead of SetWithTTL. Then only replace the value in cache if the HTTP request succeeded.

@Bucky420
Copy link
Author

yes i did look around on how you cache stuff its an api .... i used to just save there ip and call it good ..... but perhaps a simple http cache of some sort in front of all this might be ok performance and resources are of no concern to me ATM nor is complex security....for now ..... i am atm only using this internally on lan for my self so. but tbh rilly all i do is log out and login with a drasl user with the same uuid and this rilly solves my issues for now lol . if it work it works

@evan-goode evan-goode added enhancement New feature or request low priority labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority
Projects
None yet
Development

No branches or pull requests

2 participants