Skip to content

Cache NOT FOUND for providers cache #133

@hannahhoward

Description

@hannahhoward

What

After running for several days, out cache hit rate on the providers cache is around 0.3. This is likely cause people just ask our gateway for things all the time that we don't have. This ends up dropping our TTFB. (arguably for not the most important requests, but still)

Currently, we don't cache when there are NO PROVIDERS -- even though this is cachable information.
Not found caching can be a bit tricky, but since we control the write pipeline through this indexer, we can invalidate not founds right when they change.

Change

  • add the ability to cache not found to the providers cache
  • since we're using SMEMBERS, we'll need to have a way to indicate "nothing is there, but we've actually already queried" -- some kind of special "not found" member?
  • one write of a new, actual value to the cache, check if there is a single "not found" and remove it
  • check redis docs for anything that might speed this up

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions