Skip to content

Caching for WooCommerce

Ideally, it is best to cache as much content as possible for maximum performance. However, that is not always possible with a WooCommerce store depending on user sessions or the need to dynamically load content such as cart updates or price and stock feeds.

WooCommerce sites are more likely to have content that cannot be cached for all users (i.e., cart contents, account pages) or content that should not be cached for long (i.e., product inventory counts, prices).

WooCommerce provides detailed documentation for subscription cache.

Dynamic content

Evaluate methods used on pages with dynamic content (content shown to the end-user due to past website behavior) and consider more performant options.

  • Dynamic content called or stored client-side (i.e., session data, unauthenticated calls to third-party APIs, etc.) can be called or handled with JavaScript. At the same time, the remaining portions of the page are static and served from the page cache. 
  • Pages with authenticated requests to third parties for content (i.e., inventory or price data feeds, similar requests that cannot be handled client-side) will need to be served uncached to account for nonce generation.

Last updated: December 22, 2023

Relevant to

  • WordPress