autodesk-forgeautodesk-viewerautodesk-model-derivative

Forge viewer cache issue


I am using this Node.js Forge sample to check the Forge workflow

When a model with the same name as another is uploaded to the bucket, it is overwritten but when it is translated older model is displayed in the Forge viewer.
I have set xAdsForce to True to enable re-translation at Forge end. But the issue with browser-side cache still persists.

This article -- AUTODESK mentions to set the HTTP request headers, but where do I exactly set them in this code -- on GITHUB ?


Solution

  • At this line, pass xAdsForce: true. It tells the translation to override existing translations. See SDK documentation and endpoint documentation. You can also delete existing manifest (aka translations) before posting a new translation.

    Update

    You can specify the expiration header with (between lines 29 & 30 on the mentioned sample):

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

    Applies to the latest Viewer version v6