Skip to content

Only refresh My Store stats data when a new order is placed for the site. #6618

@JorgeMucientes

Description

@JorgeMucientes

wc-analytics endpoint is one of the slowest endpoints in the app, and is one that we hit a lot. We fetch site stats and top performers every time we open My Store tab and when we change between tabs.

To reduce the number of requests done to the wc-analytics endpoint, while keeping the data fresh, we will:

  • Migrate existing top performer products cache to use Room so we can apply an observable approach: PR
  • Invalidate top performer products cached data whenever a new order is placed. Here and in Feature/6618 limit stats refresh #7411
  • Add an expiration policy to cached data to top performer products, and refresh it when expired: Feature/6618 limit stats refresh #7411
  • Add an expiration policy to cached data to stats, and refresh it when expired
  • Invalidate Store stats cached data whenever a new order is placed.

Visitor stats are not included as part of this caching/invalidating policy. Visitor stats should always be refreshed.

More details here: p91TBi-8yY-p2 and here p91TBi-8V6-p2

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions