You can then stick Varnish in front of the whole lot if the search space is relatively static and not ridiculously huge.
Also with `log` you don't need to add a `\n` at the end, it will do it for you.
Btw, I noticed a missing "c" in the "url -X POST" example on this page of your docs:
I wrote a similar service (JS+Go) 2 years or so ago using only the Go standard library (specifically the excellent index/suffixarray and gobs for persistence). It typically got ~3ms response timings (locally) with > 1 million records indexed.
However, the hit ratio is too low to work. It only protects me from the stampeding herd problem at best.
Would you care to link to what you wrote?
Do you have a link to your implementation or comments on how this one could be improved?
We're using elasticsearch now which is definitely a bit more of an operational headache.
1. The focus should be on the search box when the page is loaded.
I investigated the problem and found a very good explanation for why it was happening.
2. I see. I think it only happens when the client-side cache is empty. And it only happens if you type very fast. I think the right solution would be to not hide too quickly. That's a very useful piece of feedback. Much appreciated!
I actually re-wrote it once to switch out Redis for Postgres but it was way too slow.
If this service becomes surprisingly popular I'll look into ways to monetize but that's unlikely to be the case unless I'm really really lucky.
The origin of building this is that I found a cool prototype of the concept in a blog post, then threw that into my own site and later realized I want to re-use that for a (day)work site. So I though instead of copying it, I'll write a microservice.
> Can find "Pär is naïve" by typing in "par naive"