Search Results return cached results

When I perform a search, it works the first time and I get correct search results, but if I search again immediately it returns back the results of the first search (like a cached response) If I wait for one minute and do a search again then it shows fresh results.

I’m using Fast CGI cache and I exclude the search pages from cache like this:

if ($query_string ~ "s=") {
    set $skip_cache 1;
}

I’m also using Perfmatters.

Any thoughts what I should do to fix this?

The 1st thing I’d do is verify where the caching is happening. Did you test the results with Fast CGI disabled? Did you exclude any other caching systems that could be contributing?

Good point.

Caching is on the server level, fast cgi and Redis.

I’ll test and come back.

It seems I had a toggle on in the query settings that was causing this problem
image

If I toggle off the ā€œDisable query mergeā€ it’s working fine.

When I disabled Redis, then even with this toggle on, the search queries were working fine and I thought the problem is with Redis.

In any case, I’ve switched off the toggle ā€œDisable query mergeā€ and all is good.

1 Like