No description
- JavaScript 82%
- HTML 18%
| .vscode | ||
| public | ||
| src | ||
| test | ||
| .editorconfig | ||
| .gitignore | ||
| .prettierrc | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| vitest.config.js | ||
| wrangler.jsonc | ||
Live Site
https://cloudflare-worker-express.ken-ng.workers.dev/
Deploy
pnpm run deploy
Validating Cloudflare Cache Flow
Cache Config
cdn-cache-control': 'max-age=120, stale-while-revalidate=60
cache for 120 seconds
revalidate for 60 seconds
Testing
Try to click the random button multiple times Validate the HTTP response headers
Cloudflare Worker Log
Workers & Pages > select the project > Observability > Events
Then click <Play Live> button to get the live logs
You will see something like
2026-01-13 09:43:06:218 GMT+8 | GET /random | Cache HIT
2026-01-13 09:43:06:218 GMT+8 | GET /random | Cache REVALIDATE // <-- the age header exceed the stale-while-revalidate seconds
2026-01-13 09:43:06:218 GMT+8 | GET /random | Cache HIT
2026-01-13 09:43:06:218 GMT+8 | GET /random | Cache REVALIDATE
2026-01-13 09:43:06:214 GMT+8 | GET /random | GET https://cloudflare-worker-express.ken-ng.workers.dev/random
2026-01-13 09:42:46:600 GMT+8 | GET /random | Cache HIT
2026-01-13 09:42:46:600 GMT+8 | GET /random | GET https://cloudflare-worker-express.ken-ng.workers.dev/random
2026-01-13 09:42:46:600 GMT+8 | GET /random | Cache HIT