|
/ Knowledge Base /Troubleshooting/ Caching Configuration for SureCart

Caching Configuration for SureCart

Caching plugins can significantly enhance the performance of your WordPress website. However, when using SureCart, certain caching configurations and optimisation’s can interfere with its functionality. This guide outlines the best practices and essential configurations to avoid conflicts between SureCart and caching or performance plugins.

Exclude REST API Requests

SureCart relies on WordPress’s REST API to handle dynamic content such as customer data, product information, and checkout processes. Caching REST API requests can cause outdated information to be served, resulting in issues like incorrect cart data, failed orders, or broken functionality.

Solution: Exclude all REST API requests from being cached. Ensure that your caching plugin does not cache REST API routes (/wp-json/). Most caching plugins allow excluding specific URLs from caching. Some has exclude REST API fields and some could have a direct UI to change this.

Do Not Defer Core WordPress Scripts

Core WordPress scripts such as wp-api-fetch, wp-a11y, and wp-i18n are essential for dynamic functionality and accessibility. These scripts need to load synchronously, and deferring them can break site functionality.

Solution: Ensure core WordPress scripts are not deferred by the caching or performance plugin.

Scripts to Exclude from Defer:

  • wp-api-fetch – /wp-includes/js/dist/api-fetch.min.js
  • wp-a11y – /wp-includes/js/dist/a11y.min.js
  • wp-i18n – /wp-includes/js/dist/i18n.min.js
  • wp-url-js – /wp-includes/js/dist/url.min.js

Avoid Script Combining

Combining JavaScript and CSS files was once a popular optimization technique. However, In environments using HTTP/2, combining JavaScript files is unnecessary. HTTP/2 allows for parallel loading of resources, making script combination redundant and potentially harmful to performance or functionality.

Solution: Disable the option to combine JavaScript files within the caching plugin.

Exclude Login Pages from Caching

Pages like login, registration, and customer dashboards should not be cached, as caching these pages can prevent users from accessing their accounts or logging in. These are dynamic, user-specific pages that require real-time data.

Solution: Ensure login, account, customer dashboard and checkout-related pages are excluded from caching.

Disable Browser Caching

Enabling aggressive browser caching for dynamic eCommerce data, such as checkouts or cart pages, can lead to outdated data being displayed, such as stale carts or order details. This can create serious user experience and transaction issues, as the data cannot be cleared remotely.

Solution: Disable browser caching for dynamic content, especially for checkouts, carts, and customer account pages. If your performance plugin allows fine-tuning browser caching, make sure to exclude these critical SureCart pages from those settings.

Summary

To ensure SureCart operates without caching-related issues:

  • Exclude REST API requests from caching.
  • Do not defer essential core WordPress scripts.
  • Disable JavaScript file combining, especially in an HTTP/2 environment.
  • Exclude login, checkout, and customer account pages from caching.
  • Disable browser caching for any dynamic content.
  • By following these best practices, your caching configuration will not interfere with SureCart’s dynamic features and will provide a smooth experience for your customers.
  • Always test your site thoroughly after making changes to caching settings to ensure all functionality works as expected.
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

E-Commerce Store Launch Checklist Download
Scroll to Top