Caching the results of long browser-based operations in Local Storage

In the IoT-related (and Forge Viewer-based) prototype I’m spending most of my time working on, we have a long startup operation that instantiates a number of arrays of data with information derived from the BIM. This operation only really needs to be done once per model – every user will get exactly the same information from the model that’s loaded in their own browser instance – but we were calculating it on every load of the model in the Forge Viewer.

The question I’d like to look at in this post is the appropriate method for memoization of this function call.

I’ve mentioned in the past that we can now offload this kind of operation to the server – perhaps when the model is uploaded and translated, for instance – using the Model Derivative API. That would make a lot of sense – and is the preferred longer-term solution – but it also requires a bit more infrastructure work to make happen (we need server-side processing, storage and an API to access it)….

Read more

Leave a Comment