A successful ecommerce site isn’t just about offering the right inventory to the right people — it’s also about ensuring the experience is as smooth and faultless as possible. As developers, it is your responsibility to ensure that the customizations you write not only do their jobs correctly, but also in a performant manner.
Achieving a satisfactory level of performance can be a challenge as there are a number of places that can bottleneck an entire process. Accordingly, as a developer, it is important to not only familiarize yourself with every possible place that can cause problems, but develop expertise in them too. This will mean you will code, customize and configure your site to avoid problems, and troubleshoot them when they come up.
In general, there is much advice available on the internet about improving your site’s performance. And, in general, those will not be discussed here — but feel free to listen to them, if you think their advice is appropriate. Instead, the contents of this section will cover things that are specific to NetSuite and NetSuite Commerce.
NetSuite has staff dedicated to improving performance throughout the ecosystem, including SuiteCommerce sites. They have put together performance standards for you to compare your site against.
The performance team have also put together a performance checklist PDF that discuses numerous general and NetSuite-specific areas that can impact your site’s performance, as well as what you can do to make improvements.
Notable Causes of Performance Problems
The child pages to this section covers numerous performance-related areas, but let us quickly summarize the most notable.
You should take advantage of caching whenever possible. By default, resources will be cached in the NetSuite application and in the user’s browser, but you should also take steps to enable CDN caching.
As a developer, there are also design patterns you can follow that will ensure more data is cached. For example, we have written custom modules for Backbone that add a layer of caching to models and collections, which we use, for example, to shortcut requests to the item search API if they have already been made.
We have a very detailed section on how to optimize your site’s imagery as there are a number of steps you should take to ensure they don’t become a problem.
There are a plethora things that can affect performance, so it’s hard to summarize here succinctly.
If the customization you are writing follows a lot of the coding patterns of your site’s existing SuiteScript, there shouldn’t be too much too worry about, but you can still cause problems when you try to iterate over multiple records, make multiple requests, or trigger long-running tasks.
Also keep in mind any third-party SuiteScript you’re bringing in. If you have integrations to other systems or services, they will frequently use SuiteScript and sometimes they can be the culprit of performance degradation.
A lot of business operate just fine without scriptable cart, but for some, it is essential for their business practices. Scriptable cart can have a ‘blocking’ effect on order submit, for example, and you should be wary of using it for non-essential functions that happen at this point.
Consider using workflows instead.
Fields and Field Sets
When performing an item search, your request will contain the fields or field set of the data you want back. In short, it is important that you review your field sets and remove any that are unnecessary — the fewer fields you request, the quicker the response will be.
There are also a number of synthetic fields that generate a lot of data — when using them, it is important that you only request them when you absolutely need to.
Don’t need facets? Don’t fetch them! Apart from not including them in the request URL, you can also request them but exclude specific ones.