After reading it again, I think it’s more likely to be the NGINX web server. If there are only sometimes performance drops and only with static files, then it is more likely that it is due to the NGINX configuration.
If you search for it, you will see that you are not alone with the problem: nginx static files slow - Google Search
You should check your NGINX configuration to see if you can optimize settings such as sendfile_max_chunk or worker_processes.
It is also possible that the problems only exist if there is too much access to your application.
Maybe it will help to improve the performance. The blog post is a little older but most of it should still be valid today (Note on the implementation of HTTP/2 and SPDY in the article - HTTP/3 has been standardized as RFC 9114 in 2022):
Optimizing the caching of static files and activating Gzip compression can also prevent such perfomancy drops (warning: only for production, not for development):
And as a bonus Server-side rendering:
Note: It is also possible that hardware problems on the server explain the bottleneck in accessing static files. For example, a defective hard disk, a processor that is too slow, too little memory or a hard disk that is too slow. Perhaps resources for Docker or the container are also limited too much.
And just another tip:
Try NGINX Unit instead of NGINX.
Unit is a modern and powerful web server and an app runtime environment that is stable even with high data traffic.
@christinehabel Don’t forget to format your posts / posted file contents. Please follow the guidelines: How to format your forum posts