Use preFilter
parameter with fields parameter to improve endpoint performance
The preFilter
boolean parameter can be used with fields parameter to improve endpoint performance, but this can only improve the performance when the resource being requested has structural depth.
This section applies to Open Storefront Framework (OSF) and Storefront Classic.
With flat structure resources, your performance may not improve. By default this feature is not enabled at endpoints. On store side it is enabled on these endpoints.
listSkus: /ccstoreui/v1/skus GET
listProducts: /ccstoreui/v1/products GET
listOrganizations: /ccstoreui/v1/organizations GET
Following is the example of how to use preFilter
parameter with the sku
endpoint:
/ccstoreui/v1/skus/?skuIds=ProdId&fields=listPrices.US_Dollar:repositoryId&storePriceListGroupId=US_Dollar&catalogId=reseller&preFilter=true
You can also use preFilter
for listProducts
and listOrganizations
endpoints same as the /skus
endpoint:
/ccstoreui/v1/skus/?skuIds=ProdId&fields=listPrices.US_Dollar:repositoryId&storePriceListGroupId=US_Dollar&catalogId=reseller
/ccstoreui/v1/skus/?skuIds=ProdId&fields=listPrices.US_Dollar:repositoryId&storePriceListGroupId=US_Dollar&catalogId=reseller&preFilter=true
Note: The response of these examples may not be same.
Issues with fields parameter
The fields parameter does not provide a performance improvement for the first endpoint invocation and with non-cached endpoints. If you set preFilter=true
, and if the response contains a nested structure and you do not want nested data always, in those cases if you are using fields parameter with preFilter
flag, you will see a performance improvement.