Troubleshooting: Live store does not show SKU price index updates
On a Live storefront, cached pages do not update in the storefront after changing a product SKU price and reindexing, even though the REST API shows that they have changed.
Problem
- You or a customer has browsed a set of Live storefront pages. This results in these pages being cached for future use.
- You change the product SKU price of such cached pages as a workspace task under the Quick Publish task group in the Management Center.
- The store preview shows that the pages have been properly updated to show
the new price. So does the REST API call,
eg.,
where server-address:server-port is the URL for your search server, and yourproductIdis the numerical identifier for the product.http://server-address:server-port/search/resources/store/1/productview/byId/yourproductId
- In the Live storefront, browse to the product display page for yourproductId. The old (cached) SKU price information is still displayed.
Cause
By default NiFi is configured with an invalidation processor that sends invalidation request to the cache for items that have been changed. Not all stores use the same dependency IDs to trigger invalidation, however. This can result in an incoming invalidation message not matching with any expected ID within a given store. Such mismatched invalidation requests are lost.
Solution
You can use the Ingest update API to specify that dependency IDs must be sent with a certain format, and with certain values. Doing this requires two calls to the update API.
- Call to change the dependency format and values of
Push-to-Live.
PUT http://Ingest_Host:Ingest_Port/connectors BODY { "name": "push-to-live", "pipes": [ { "name": "WorkspacePublishing", "label": "Workspace Fine Grain Invalidations", "properties": [ { "name": "properties.Product Invalidation Template", "value": "storeId:partNumber:{supportedStoreId}:{productPartNumber};storeId:partNumber:{supportedStoreId}:{partNumber};storeId:categoryId:{supportedStoreId}:{parentCategoryId}", "scope": { "name": "Workspace Publishing Invalidations.WorkspacePublishInvalidation", "type": "PROCESSOR" } } ] } ] }
- Call to change the dependency format and values of quick
publish.
PUT http://Ingest_Host:Ingest_Port/connectors BODY { "name": "auth.publish", "pipes": [ { "name": "PublishWorkspaceChange", "label": "Workspace Approval", "properties": [ { "name": "properties.Product Invalidation Template", "value": "storeId:partNumber:{supportedStoreId}:{productPartNumber};storeId:partNumber:{supportedStoreId}:{partNumber};storeId:categoryId:{supportedStoreId}:{parentCategoryId}", "scope": { "name": "Workspace Publishing Invalidations.WorkspacePublishInvalidation", "type": "PROCESSOR" } } ] } ] }
With this change to the template, invalidation requests after SKU price changes will now be recognized and executed by all storefronts.