Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.
ake133c edited this page Feb 7, 2022 · 26 revisions

Cache miss after the adoption

Problem

During the clear and load of initial data from the WebApplication directory by issuing command run dotnet run initialize=true clear=true uploaded models are taken from the Zip archive. Parameter are extracted for the model and concatenated into the string. That string is then used for generating the hash and hash is then used for the caching. However, though this cache exists, application don't use it and open the model again and generate the new cache with a new hash value next to the existing cache.

Reason

Cache created during the initialization will not be used during the application run in case of earlier versions of inventor were used for the Model creation. The reason is the inconsistency of the model parameters in different versions of the Inventor that was used for creating those initial models and the version that is used by the application now. String parameters value are having slightly different representation and the composed parameter string that is used for the cache generation varies.

Example for the Wheel model

String used for caching during the initialization

"BrakeMaterial-"Cast Iron";CaliperFinish-"Light Red";NumberOfSpokes-6 ul;Slot-True;TotalPrice-"1085";WheelFinish-"Chrome - Polished";WheelSize-22 in;"

String used for caching during the normal run of the application

"BrakeMaterial-"Cast Iron";CaliperFinish-"Light Red";NumberOfSpokes-"6 ul";Slot-True;TotalPrice-1085;WheelFinish-"Chrome - Polished";WheelSize-"22";"

There are slight differences mainly in specifying the units and quotes. This leads to the GenerateParametersHashString() function in ..\WebApplication\Utilities\Crypto.cs to generate the different hash that is used for caching. As this hash is used for caching, cache miss occurs.

Solution

Step 1: Open the model in the application and press the Update button. This will regenerate cache.

Step 2: Download the IAM/IPT model from the application.

Step 3: Use the ZIP downloaded in the step 2 for the upload

Clone this wiki locally