1

I have a search api based view. The index this view is based on indexes new content as soon as it is published. When new contest is published, logged in users can indeed see the latest content at the top of the search results.

However, anonymous users don't see the newly published content until the cache is cleared. How do I avoid having to manually clear the cache? What should I check?

2 Answers 2

3

Is it possible you have a "non Drupal" cache for anonymous users? Common such caches include Varnish (server based) or Cloudflare (cloud/cdn based)

Failing that, have you checked the cache settings on the view itself? I believe for search API the correct settings should be Caching: Search API (tag based) (under advanced in the view edit screen). If that doesn't work you could try turning off the views cache temporarily to at least determine if that is the root cause.

Finally check your modules are up to date, including Search API & check the issue queue to see if there are any patches that may solve your issue: https://www.drupal.org/project/issues/search_api?categories

“There are only two hard things in Computer Science: cache invalidation and naming things”

1
  • This is the closest answer. I did resolve this a while ago and it turned out to be due to a bug that was resolved in one of the updates.
    – lolcode
    Commented Dec 6, 2021 at 15:24
1

Looks like you should use the 'none' cache to option (if using solr or any facets) or 'Search API (tag-based)' option. There is a bug where this is not set automatically.

@see https://www.drupal.org/project/search_api/issues/3196990

@see https://www.drupal.org/project/facets/issues/2939710

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.