javascript - What happens when the web side requests a file that is being modified?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 13:34:38
0
1
424

I encountered a problem. The web side requested a picture, but the picture was modified dozens of times per second on the server side.
Server-side nodejs uses fs.createReadStream(image_path).pipe(response); to return images.
I tested the python single thread to modify the image 10 times per second.
When the web side requests the image, the request will not be available. Only small data can be requested, and it will not continue to come after continuing to wait. The stream is flowing
I can only try F5 frequently to try my luck
Is there any way to process it in the backend so that the frontend can definitely get this picture?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
漂亮男人

Don’t use stream if you make frequent modifications. Pictures can be read into the memory using the synchronous method and then passed to the client

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!