Push To Cache Usage Scenario: Quick Access to E-Commerce Product Filters

In an e-commerce application, the user selects product filters, and these filter results will be used again in the next step or on another page. With the Push To Cache action, these filters are saved to the cache, so even if the user changes the page or closes the application for a short time, the data can be retrieved quickly.

Step-by-Step Usage

  1. User Filter Selection
    • The user selects filters such as brand, color, and price range on the product list page.
    • Sample data: { “brand”: “Nike”, “color”: “Red”, ‘priceRange’: “500-1000” }
  2. Executing the Push To Cache Action
    • When the user applies the filters, they click the “Apply Filters” button.
    • The Push To Cache action is added to this button as an OnClick action.
    • Parameters:
      • Cache Key: user_123_filters
      • Cache Item: Filter data { “brand”: “Nike”, “color”: “Red”, ‘priceRange’: “500-1000” }
  3. Cache Provider Selection
    • Redis was selected for the web application. The user connected their own Redis instance from the configuration manager.
    • InMemory was selected for the mobile application; data will be deleted when the application is closed.
  4. Data Saving
    • The Push To Cache action saves the filters to the selected cache provider.
    • If the key has been added before, the previous value is overridden with the new data.
  5. Use in Other Actions
    • The product listing page retrieves the data using Fetch From Cache on the next page or in the filter summary panel.
    • Example: When the user clicks the “Saved Filters” button, the user_123_filters key in the cache is read and the filters are populated into the form fields.
  6. Testing and Validation
    • Web: Verify the cache using the KEYS * and GET user_123_filters commands in the Redis CLI.
    • Mobile: Can be tested in InMemory cache preview mode; verify that values are lost when the application is closed.