Skip to content

Add the ability to cache dynamic filters between requests #4423

Open

Description

Description

Follow on from #4390.

While looking into this issue to add an advanced filter to filter by customer currency, we needed the option values for the filter to be populated dynamically based on the TransactionSummary. However, in reality, this value will rarely change, as it will only be updated the first time a new currency is used on the site, so I think we could cache it on first page load, rather than re-calculating it every time the user makes a query.

I spoke with @ismaeldcom about this, and he had the idea to cache it (ref: p1657278821767129/1657188059.196539-slack-C03KTTK2YM). This worked well, but we decided it would be better to move this into a new issue and implement a generic solution that would work for all of the filters we use in WCPay.

Acceptance criteria

  • Dynamic filter options can be cached on page load, and are not re-rendered every time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions