Caching support for self-service APIs

Starting with the 25C release, Oracle Commerce allows merchants to manage cache configurations for Self-Service APIs. Merchants can:

  • Enable or disable caching
  • Specify which APIs should be cached
  • Define custom cache timeout values for each API

The following APIs that are eligible to be cached: listQuotes, listOrders, listSubscriptions, listAssets, listInvoices, listCreditMemos

This feature empowers merchants to:

  • Provides merchants the flexibility to fine-tune caching behavior based on business needs
  • Enhances performance and responsiveness for frequently accessed self-service data.

Steps to Enable

The feature is enabled by default. Merchants can use the saveSelfServiceCacheConfiguration API to tune their cache configurations.

API: PUT /ccadminui/v1/merchant/selfServiceCacheConfiguration

Payload:

{
  "cacheConfiguration": {
   "<API to be cached>": <cache timeout in minutes>"
  },
  "enabled": true
}




Sample Payload:

{
  "cacheConfiguration": {
    "^/ccstore/v1/selfservice/subscriptionProducts[?]orderBy=EndDate:asc&q=SalesProductType='SUBSCRIPTION' AND Status in [(]'ORA_ACTIVE'[)] AND [(]EndDate BETWEEN '\\d{4}\\-(0?[1-9]|1[012])\\-(0?[1-9]|[12][0-9]|3[01])' AND '\\d{4}\\-(0?[1-9]|1[012])\\-(0?[1-9]|[12][0-9]|3[01])'[)]&totalResults=true$": 5,
    "^/ccstore/v1/selfservice/quotes[?]limit=10&offset=0&totalResults=true&orderby=lastUpdatedDate_t:desc$": 15
  },
  "enabled": true
}

Tips And Considerations

  • To view the default cache settings, use the getSelfServiceCacheConfiguration API and check the defaultCacheConfiguration object in the response.
  • If a custom cacheConfiguration is provided, it overrides the default list. Be sure to include all desired APIs, as defaults will be ignored.
  • OSF uses the configured cache timeout to trigger cache invalidation events automatically.
  • Merchants can define up to 80 cacheable API URL patterns.