November 20, 2020

Viewer keeps showing old model

We already blogged about this issue, but I thought I'd update the solution shown there for v7 of the Viewer and also point out something about the Model Derivative API.

When you generate derivatives (inc. SVF) for a given file then those will not get deleted if you update or even delete the original file.
In order to get new derivatives generated, you need to either delete the manifest before requesting the translation again or force the translation to take place using the x-ads-force header.

After making sure that the SVF is up-to-date, you'll still run into the caching issue pointed out in the article I referenced above.

In case of Viewer v7 the previously mentioned solution would look like this:

Autodesk.Viewing.endpoint.HTTP_REQUEST_HEADERS['If-Modified-Since'] = "Sat, 29 Oct 1994 19:43:31 GMT"

You could set it at any time before loading the model - could do it even before creating the Viewer object.

Related Posts