Product Merchandising Rule Caching Optimization for SuiteCommerce

Optimize product merchandising rule caching in SuiteCommerce to enhance performance by adjusting the cache time to as low as five minutes.

·2 min read·2 views·View Oracle Docs

Caching product merchandising rules significantly enhances performance by reducing the time new rules take to become active. By default, a new merchandising rule becomes active after approximately two hours. For businesses needing quicker updates, adjustments can be made within the DM_SS_Library.js file of the Product Merchandising bundle.

How to Adjust Caching Times

Caching for product merchandising rules is handled through the TTL = attribute, which is defined in two instances:

  • The default setting is MAX_TTL, imposing a two-hour cache duration.
  • To expedite the activation of merchandising rules, change both instances to MIN_TTL, effectively shortening the cache time to about five minutes.

Keep in mind that while reducing cache times can improve responsiveness, it may also impact overall system performance due to increased load.

Code Sample for Setting TTL

The following JavaScript function can be used to set the time-to-live (TTL) value for your caching rules:

javascript
1"text-purple-400">function setTTL(paramValue){
2 //ttl is not defined
3 "text-purple-400">if(paramValue == null || paramValue == undefined || paramValue == ''){
4 ttl = MAX_TTL;
5 "text-purple-400">return ttl;
6 }
7
8 //ttl is defined but invalid
9 "text-purple-400">var paramValueInt = parseInt(paramValue);
10 "text-purple-400">if(isNaN(paramValueInt) || paramValueInt < MIN_TTL || paramValueInt > MAX_TTL){
11 ttl = MAX_TTL;
12 "text-purple-400">return ttl;
13 }
14 "text-purple-400">else{
15 ttl = paramValueInt;
16 "text-purple-400">return paramValueInt;
17 }
18}

This function checks for valid TTL values and assigns MAX_TTL as a fallback if provided input is invalid.

Related Caching Concepts

Understanding how to efficiently manage caching is critical for maintaining optimal site performance. Familiarize yourself with:

  • Cache Invalidation: Learn how to clear the cache before expiration to reflect updated data.
  • CDN Caching: Explore caching mechanisms at the Content Delivery Network level.

Who This Affects

This information is especially relevant for:

  • Developers implementing product merchandising rules.
  • Administrators looking to optimize system performance.
  • E-commerce managers aiming to enhance user experience through faster product updates.

Key Takeaways:

  • Default caching for product merchandising is set to two hours.
  • Modifying the caching duration can reduce time for new rule activation to five minutes.
  • Caching performance can be fine-tuned through the adjustment of parameters in DM_SS_Library.js.
  • Proper management of caching is essential to balance performance and resource load.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

What file must I modify to adjust the caching time for product merchandising rules in SuiteCommerce?
You need to modify the `DM_SS_Library.js` file in the `Product Merchandising` bundle to adjust the caching time.
How can I reduce the default caching time for product merchandising rules from two hours to five minutes?
To reduce the caching time, change both instances of the `TTL =` attribute from `MAX_TTL` to `MIN_TTL` in the `DM_SS_Library.js` file.
Does reducing the cache time for merchandising rules affect system performance?
Yes, reducing the cache time can improve responsiveness but may also impact overall system performance due to the increased load.
What happens if the TTL value set for caching is invalid?
If an invalid TTL value is provided, the function will default to using `MAX_TTL` as a fallback within the JavaScript function.
Source: Product Merchandising Rule Caching Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Commerce

View all Commerce articles →