https://github.com/gatewayd-io/gatewayd-plugin-cache
GatewayD plugin for caching query results
https://github.com/gatewayd-io/gatewayd-plugin-cache
caching gatewayd in-memory-caching plugin postgres postgresql redis
Last synced: 5 months ago
JSON representation
GatewayD plugin for caching query results
- Host: GitHub
- URL: https://github.com/gatewayd-io/gatewayd-plugin-cache
- Owner: gatewayd-io
- License: agpl-3.0
- Created: 2023-01-07T00:18:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-08-07T15:53:05.000Z (11 months ago)
- Last Synced: 2025-08-07T18:16:50.430Z (11 months ago)
- Topics: caching, gatewayd, in-memory-caching, plugin, postgres, postgresql, redis
- Language: Go
- Homepage: https://docs.gatewayd.io/plugins/gatewayd-plugin-cache
- Size: 395 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gatewayd-plugin-cache
GatewayD plugin for caching query results.
## Features
- Basic caching of database responses to client queries
- Invalidate cached responses by parsing incoming queries (table-based):
- **DML**: INSERT, UPDATE and DELETE
- **Multi-statements**: UNION, INTERSECT and EXCEPT
- **DDL**: TRUNCATE, DROP and ALTER
- **WITH clause**
- **Multiple queries** (delimited by semicolon)
- Periodic cache invalidation for invalidating stale client keys
- Support for setting expiry time on cached data
- Support for caching responses from multiple databases on multiple servers
- Detect client's chosen database from the client's startup message
- Skip caching date-time related functions
- Prometheus metrics for quantifying cache hits, misses, gets, sets, deletes and scans
- Prometheus metrics for counting total RPC method calls
- Logging
- Configurable via environment variables
## Build for testing
To build the plugin for development and testing, run the following command:
```bash
make build-dev
```
Running the above command causes the `go mod tidy` and `go build` to run for compiling and generating the plugin binary in the current directory, named `gatewayd-plugin-cache`.
## Sentry
This plugin uses [Sentry](https://sentry.io) for error tracking. Sentry can be configured using the `SENTRY_DSN` environment variable. If `SENTRY_DSN` is not set, Sentry will not be used.