Regenerate Cache Batch Process Examples and Best Practices
The scenario in this topic illustrates the most common implementation and results of using the Regenerate Cached API Records job to specify a cache effectivity date.
On December 12th, (after setting CacheAPI.RegenerateFutureDatedCache=True) the Product Admin makes changes to the product catalog. The Product Admin then executes the Regenerate Cached API Records batch job and specifies December 13th at 12:00 a.m. as the cache effectivity date.
As a result, the API CacheRespond object will contain the original cache effectivity date and will contain the updated cache entries with the future effective date.
On December 13th at 12:00 a.m., all Digital Commerce API Cache requests will respond with the product model changes that were made on December 12th.
On December 13th, the Product Admin again makes changes to the Product Catalog. The Product Admin executes the Regenerate Cached API Records batch job and specifies December 14th at 12:00 a.m. as the cache effectivity date.
As a result, the API CacheRespond object will contain the original cache effectivity date and will contain the update cache entries with the future effective date.
On December 14th at 12:00 a.m., all Digital Commerce API Cache requests will respond with the product model changes that were made on December 13th.
Only one version of the future-date cache is honored. The current regenerate future-dated cache feature is intended for customers who make frequent changes to their product model.
If you have already run the Regenerate Cached API Records batch job and specified an effectivity date, but would like to make product model changes prior to the specified effective date, see the following scenario.
On December 12th, the Product Admin makes changes to the product catalog. The Product Admin executes the Regenerate Cached API Records batch job and specifies January 1st at 12:00 a.m. as the cache effectivity date.
As a result, the API CacheResponse object will contain the original cache effectivity date and will contain the updated cache entries with the future effective date.
On December 13, the Product Admin again makes changes to the product catalog. The Product Admin executes the Regenerate Cached API Records batch job and specifies January 1st at 12:00 a.m. as the cache effectivity date.
As a result, no changes will be made since only one future-date version is supported. If the Product Admin wants to commit changes made on December 12 and December 13, then the administrator must first do the following:
-
Query the CacheChangeObject and set the IsProcess Flag to F for all records created on December 12th and December 13th.
-
Delete Cache Records in the API CacheResponse where EffectiveStartDate = January 1st 12:00 a.m.
-
Run the Regenerate Cached API Records job.
After completing the previous steps, on January 1st at 12:00 a.m., all Digital Commerce API cache requests will respond with the product model changes that were made on December 12th and 13th. Generally speaking, it is recommended that you run the Regenerate Cached API Records batch job only after the specified future-dated cache has passed.
Do not modify the CacheAPI.RegenerateFutureDatedCache if you have existing future-dated cache entries.