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

Is there a way to trigger a cache reload? #18

Closed
AndreasBraun2015 opened this issue Dec 11, 2018 · 3 comments
Closed

Is there a way to trigger a cache reload? #18

AndreasBraun2015 opened this issue Dec 11, 2018 · 3 comments

Comments

@AndreasBraun2015
Copy link

If I change something in the user, the cache still shows the old value. Is there a simple way to trigger a cache reload?

Many thanks for any help!

Best
Andreas

@zanderxyz
Copy link
Owner

Hi!

Cachex.clear(:veil_users) will clear the cache, but that is probably not what you want to do, as it will clear ALL the users. Cache.del(:veil_users, USER_ID) will clear a specific user for a given USER_ID.

Are you updating the User using the YourApp.Veil.update_user/2 function? If you do, it should change the cache after the update to refer to the updated user.

Thanks
Zander

@zanderxyz
Copy link
Owner

That should read Cachex.del(:veil_users, USER_ID)

@AndreasBraun2015
Copy link
Author

Perfect, many thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants