SAP / spartacus

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud that communicates exclusively through the Commerce REST API.
Apache License 2.0
741 stars 388 forks source link

Performance: cache parsed url segments of configured paths #659

Open Platonn opened 5 years ago

Platonn commented 4 years ago

In a storefront there are many links to varius Product Pages. They are rendered dynamically, based on the routing configuration and the product's data

Now we make some repetitive computations on the routing config on every time we render a link in the UI. But the config is static, so any computations could be made once and results cached.

Candidates to cache in the SemanticPathService (where path means a path from config):

See https://github.com/SAP/spartacus/blob/167801c/projects/core/src/routing/configurable-routes/url-translation/semantic-path.service.ts#L155