xilopaint Posted January 23, 2019 Share Posted January 23, 2019 Hey folks, what's the best way to cache search results while querying a web API? Should I cache results for each user query after the cache expiration or there's a better way? @deanishe @vitor Link to comment
deanishe Posted January 24, 2019 Share Posted January 24, 2019 What do you mean "cache results […] after the cache expiration"? Link to comment
xilopaint Posted January 24, 2019 Author Share Posted January 24, 2019 (edited) Let's say I set a 1h lifetime to the cache. During this time all queries and results are cached. Each time a query is repeated the results are retrieved from cache. After the expiration, the cache is cleared and the process should be repeated. It turns out I'm pretty sure this is not the best way, so this thread. Edited January 24, 2019 by xilopaint Link to comment
deanishe Posted January 24, 2019 Share Posted January 24, 2019 I don’t follow you. What’s wrong with that way? It’s impossible to say anything concrete without an example. It’s fine to cache some things for an hour. Others for only a few minutes, and some not at all. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now