Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ Full configuration example:
cacheGetTimeoutInMs: 1000, // Timeout for getting cached data in milliseconds (default is 1 second, redis only)
autoPurgeCache: true, // Automatically purge cache on content CRUD operations
autoPurgeGraphQL: true, // Automatically purge GraphQL cache on content CRUD operations
graphqlDependencies: { // Custom GraphQL root fields and the content types they read
eventByUUID: ['api::event.event', 'api::event-start-date.event-start-date'],
},
autoPurgeCacheOnStart: true, // Automatically purge cache on Strapi startup
disableAdminPopups: false, // Disable popups in the admin panel
disableAdminButtons: false, // Disable the purge cache buttons in the admin panel. Use true for all content types or an array like ['/api/products'] for specific content types
Expand Down Expand Up @@ -121,6 +124,7 @@ Possible configuration keys are listed below; omitted keys keep the plugin defau
| `cacheGetTimeoutInMs` | Max time to wait for a cache read before treating it as a miss (redis only) | Milliseconds (default: `1000`) |
| `autoPurgeCache` | Invalidate relevant REST cache entries after content create/update/delete | `true` or `false` (default: `true`) |
| `autoPurgeGraphQL` | Invalidate GraphQL cache after content create/update/delete | `true` or `false` (default: `false` if omitted; set `true` to enable) |
| `graphqlDependencies` | Additional GraphQL root fields to invalidate when any of their declared content types change; requires `autoPurgeGraphQL: true` | Object mapping root field names to arrays of content-type UIDs (default: `{}`) |
| `autoPurgeCacheOnStart` | Clear the cache when Strapi starts | `true` or `false` (default: `true`) |
| `disableAdminPopups` | Turn off admin UI notifications for cache actions | `true` or `false` (default: `false`) |
| `disableAdminButtons` | Hide manual purge controls in the admin (list and edit views), either globally or for specific REST content type paths | `true`, `false`, or an array of paths such as `['/api/products', '/api/tags']` (default: `false`) |
Expand All @@ -141,6 +145,7 @@ All of these routes are protected by the policies `admin::isAuthenticatedAdmin`
- **Storage**: The plugin keeps cached data in memory, Redis or Valkey, depending on the configuration.
- **Packages**: Uses [lru-cache](https://github.com/isaacs/node-lru-cache) for in-memory cache. Uses [ioredis](https://github.com/redis/ioredis) for Redis and [iovalkey](https://github.com/valkey-io/iovalkey) for Valkey caching.
- **Automatic Invalidation**: When `autoPurgeCache` is enabled (default), relevant REST cache entries are invalidated on content create, update, or delete. REST invalidation honors `excludeRoutes`, `cacheableEntities`, and `cacheableRoutes`, and runs in the background so content writes do not wait for cache scans to finish. When `autoPurgeGraphQL` is enabled, GraphQL cache is invalidated the same way (it is off unless you set it in config).
- **Custom GraphQL Dependencies**: Declare custom resolver dependencies with `graphqlDependencies`. For example, the mapping above invalidates `eventByUUID` on event or event-start-date changes, alongside standard queries for the changed content type. Unrelated queries remain cached.
- **`no-cache` Header Support**: Respects the `no-cache` header, letting you skip the cache by setting `Cache-Control: no-cache` in your request.
- **Default Cached Requests**: By default, caches all GET requests to `/api` (or whatever prefix you defined) and POST requests to `/graphql` or predefined graphql route from graphql plugin config. You can customize which routes or entities to cache using `cacheableRoutes` or `cacheableEntities` config options.

Expand Down
23 changes: 0 additions & 23 deletions jest.integration.config.js

This file was deleted.

Loading
Loading