You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-11Lines changed: 18 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,16 +16,24 @@ When running E2E tests in parallel, you might need to:
16
16
✅ Authenticate user only once\
17
17
✅ Seed database only once\
18
18
✅ Compute heavy values on demand\
19
-
✅ Reuse those values across workers\
20
-
✅ Persist some values between test runs
19
+
✅ Reuse heavy-computed values across workers\
20
+
✅ Persist heavy-computed values between test runs
21
21
22
22
Global Cache makes all of this possible.
23
23
24
-
## How it works
24
+
## How it works?
25
25
26
26
The first worker that requests a value becomes responsible for computing it. Others wait until the result is ready — and all workers get the same value. The value is cached in memory or on the filesystem and reused by subsequent workers and test runs:
<details><summary>What happens under the hood?</summary>
33
+
34
+
Under the hood, Global Cache spins up a tiny HTTP server, with a simple REST API for getting and setting values. This server is a single storage point for all workers. When a worker needs a value, it performs a `GET` request to the server, and either gets a cached value instantly or computes the value and sets it via the `POST` request.
35
+
36
+
</details>
29
37
30
38
## Index
31
39
@@ -59,7 +67,7 @@ The first worker that requests a value becomes responsible for computing it. Oth
59
67
*[Debug](#debug)
60
68
*[Changelog](#changelog)
61
69
*[FAQ](#faq)
62
-
*[How to use Global Cache in AfterAll hook?](#how-to-use-global-cache-in-afterall-hook)
70
+
*[How to use Global Cache in the AfterAll hook?](#how-to-use-global-cache-in-the-afterall-hook)
63
71
*[Feedback](#feedback)
64
72
*[License](#license)
65
73
@@ -71,7 +79,7 @@ Currently Global Cache is primarily developed for [Playwright](https://playwrigh
71
79
72
80
### Install
73
81
74
-
Install via any package manager:
82
+
Install via any package manager. For example, npm:
75
83
76
84
```sh
77
85
npm i -D @global-cache/playwright
@@ -83,17 +91,16 @@ Enable Global Cache in the `playwright.config.ts`:
0 commit comments