Fix cache invalidation issues

The caching of search results was not specific enough, so any searches
with the same number of results and the same max updated_at would
return the same Etag.