Skip to content

Commit

Permalink
stale while revalidate (#46)
Browse files Browse the repository at this point in the history
* stale while revalidate

* revalidation logic

* remove extra await

* Refactor and expose redis callers

* testing and remove await for bg revalidation

* rework ttl naming + customize long ttl

* pipeline nx

* test without pipelining

* fix no-pipelining redis set tracing revalidation

* changesets

* final assertions

* switch swr and data key

* rename to revalidation key

* setCache/readCache swr mode
  • Loading branch information
PabloSzx authored Apr 20, 2023
1 parent de0ac14 commit c56e073
Show file tree
Hide file tree
Showing 7 changed files with 881 additions and 92 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-rice-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@soundxyz/fine-grained-cache": patch
---

Expose redis interaction functions
5 changes: 5 additions & 0 deletions .changeset/itchy-icons-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@soundxyz/fine-grained-cache": minor
---

New "getStaleWhileRevalidate" function
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"ioredis": "^5.3.2",
"prettier": "^2.8.7",
"redlock": "5.0.0-beta.2",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"wait-for-expect": "^3.0.2"
},
"peerDependencies": {
"ioredis": "^5.2.4",
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c56e073

Please sign in to comment.