Scenario: In an e-commerce application, the user has previously saved product filters with Push To Cache. However, they now want to clear the old filters. With the Remove From Cache action, these filters are deleted from the cache, and subsequent Fetch From Cache operations cannot return data from this key.
Step-by-Step Usage
- Clearing User Filters
- After applying the user filters, the user clicks the “Clear Filters” button.
- Executing the Remove From Cache Action
- Remove From Cache is added to this button as an OnClick action.
- Parameters
- Cache Key: user_123_filters
- Cache Provider
- Redis was selected for the web application, and the user connected their own Redis Instance from Configuration Manager.
- InMemory was selected for the mobile application; values will be deleted when the application is closed.
- Data Deletion
- The Remove From Cache action deletes the specified cache key and related data from the selected cache provider.
- Use in Other Actions
- The key that could previously be used with Fetch From Cache is no longer valid.
- Example: Even if the user opens the “Saved Filters” panel, the user_123_filters key will not be found and the filters will not be loaded into the form fields.
- Testing and Verification
- Web: Verify that the key has been deleted with the KEYS * and GET user_123_filters commands in Redis CLI.
- Mobile: Test that the data has been deleted by running the action in InMemory cache preview mode.