'Way of caching a file in memory in Angular

I've been asked to check on an existing Angular application the bottleneck that happens when a number of concurrent access is elevated.

The scenario is the following:

  • I have a binary file (Potree binary file that represents a cloud of points) that's under the assets folder
  • An Angular application that shows the point and when zooming/moving around the map gets a portion of the file, performing a get passing as HttpHeader a Range that's the portion of the file to retrieve.

I've tried to load test with JMeter and with 10 threads it's fine... if I run with 500 threads I start receiving a lot of pending requests and HTTP 500 ( even on the web app while navigating from another PC and performing zoom/move around the map)

For now, I've not the access to the machine that hosts the content, but I think that the way the file is served (it's a 300mb files, that's why only some portion are sent) (I mean doing chunks) cause the problem.... is there a way I can cache it?

The file is accessed via HTTP on an url that's similar to

xxx/assets/models/octree.bin

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source