Jump to content
xilopaint

Caching search results

Recommended Posts

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

Share this post


Link to post

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 by xilopaint

Share this post


Link to post

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.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×