We need a function to be able to invalidate a cached value.
This can be used, so we can invalidate when we for example updates a new value, then can we invalidate the cache in the database.
We can do one of two things:
- Populate the fastify instance to have a
.clearCache(key) function, which clears the key in the database
- Have an option on POST/PATCH endpoint that when
onSend clears the specific key, which is specified on the endpoint.