Reduce and Reuse Scripts

Salesforce B2C Commerce has the following recommendations for optimizing JavaScript via B2C Commerce script in your pages:

Unobtrusive JavaScript

Using unobtrusive JavaScript can be better than extensive HTML markup. This makes the page smaller and the JavaScript is on the bottom, so it renders faster. You can also try to do the same for Flash files: give a progress bar and render the page, with the JavaScript at the bottom of the page.

Test DOM Modifications

If you modify the DOM on-the-fly, this might slow down page loading performance. If you need to modify the DOM, test the performance with multiple browsers and browser versions.

Related Links

Tools for Improving Site Performance

Techniques for Improving Site Performance

Testing Site Performance

Optimizing First Pages

Optimizing General Site Pages

Make Fewer Smaller HTTP Requests

Reduce URL and Page Size

404 Errors and 404 Pages

Performance and Stability Coding Standards