Skip to content

Conversation

@ChrisPenner
Copy link
Member

@ChrisPenner ChrisPenner commented Feb 10, 2025

Overview

Redis caching is fast, but is ephemeral, there are some things where it makes sense to keep longer-lived caches, especially since using immutable hashes means we often don't ever need to bust the cache.

This adds a generic mechanism for long-lived caches which are backed by Postgres.

Implementation notes

  • Adds a new table which stores json blobs keyed by codebase, topic, and an arbitrary cache key.
  • Adds usingJSONCache helper for easily creating/using cached values.

Test coverage

Tested locally.

@ChrisPenner ChrisPenner merged commit aef0e12 into main Feb 12, 2025
2 checks passed
@ChrisPenner ChrisPenner deleted the cp/json-caching branch February 12, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants