br-idempotency
CommunityPrevent duplicate writes with idempotent routes.
AuthorLonsdale201
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Write operations in WordPress plugins can run the risk of executing twice when clients retry requests due to network hiccups. IdempotencyMiddleware with a storage-backed cache ensures the first response is reused for subsequent identical requests within a TTL, preventing unintended duplicates.
Core Features & Use Cases
- Apply IdempotencyMiddleware to POST, PUT, and PATCH routes to prevent duplicate side effects.
- Choose storage backends (ArrayIdempotencyStore for tests, TransientIdempotencyStore for cached data, or WpdbIdempotencyStore for production) and ensure installSchema is run on plugin activation.
- Use a custom keyResolver or the default identity-aware key to bucket requests, and toggle requireKey to enforce header presence.
Quick Start
Install the idempotency store on plugin activation and apply IdempotencyMiddleware to your write routes with a valid Idempotency-Key.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: br-idempotency Download link: https://github.com/Lonsdale201/wp-agent-skills/archive/main.zip#br-idempotency Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.