feature: hard delete by tag operation
As already outlined in https://github.com/Julien-R44/bentocache/issues/71, in my opinion the current naming of the deleteByTag operation is a bit misleading, since it doesn't hard delete cache entries by tag matching, but rather expires them. That's why I included a commit in this PR renaming the current deleteByTag operation to expireByTag to be compliant with the naming of the key based operations.
I'm aware that this means a breaking change in the API and I'm open to discuss how to resolve this if a major release is to avoid.
The main concern of this PR is the implementation of a new operation deleteByTag, which performs a "kind of" hard delete via a lazy deletion logic via invalidation timestamps similar to the approach of the expireByTag (previously deleteByTag) operation.
Here I'm also open to discuss the best approach for the hard deletion logic.
⚠️ No Changeset found
Latest commit: ce6b2c197d2b701669a83e4abbd17e37495f4f9a
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Thanks a lot for the PR and sorry forlate reply, i have been pretty busy these last weeks...
Just a quick ( and maybe naive) question: instead of doing a double round-trip to check hard and soft tag keys separately, what about storing some metadata inside the tag value?
Something like:
await this.stack.set('___bc:t:users', { timestamp, type: 'hard' | 'soft' })