Skip to content

feat: config flag to enable cache clear on startup#114

Merged
trijpstra-fourlights merged 3 commits intomainfrom
feat/clear-cache-on-startup
Dec 19, 2025
Merged

feat: config flag to enable cache clear on startup#114
trijpstra-fourlights merged 3 commits intomainfrom
feat/clear-cache-on-startup

Conversation

@trijpstra-fourlights
Copy link
Contributor

@trijpstra-fourlights trijpstra-fourlights commented Dec 19, 2025

This PR adds a configuration option to control whether the plugin should clear the cache upon Strapi startup.

This is useful when cache entries have become stale due to changing content-types.

Related #112

@trijpstra-fourlights trijpstra-fourlights force-pushed the feat/clear-cache-on-startup branch 2 times, most recently from dfc5a21 to ee7c0b9 Compare December 19, 2025 11:43
Adds a new `cacheOptions.clearCacheOnStartup` configuration, enabling automatic clearing of the plugin's cache when the Strapi server starts. This helps maintain data consistency during deployments or development cycles.
These tests verify that the cache is correctly cleared (or not cleared) based on the `clearCacheOnStartup` configuration option during plugin initialization. It also includes error handling for cache deletion.
Add configuration example and explanation for the clearCacheOnStartup cache option, including details about cache persistence and potential staleness after content-type updates.
@trijpstra-fourlights trijpstra-fourlights force-pushed the feat/clear-cache-on-startup branch from ee7c0b9 to a403ac9 Compare December 19, 2025 11:53
@trijpstra-fourlights trijpstra-fourlights changed the title feat: config to clear cache on startup feat: config flag to enable cache clear on startup Dec 19, 2025
@trijpstra-fourlights trijpstra-fourlights marked this pull request as ready for review December 19, 2025 11:54
@trijpstra-fourlights trijpstra-fourlights merged commit 04d7614 into main Dec 19, 2025
2 checks passed
@trijpstra-fourlights trijpstra-fourlights deleted the feat/clear-cache-on-startup branch December 19, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant