DEV Community

Discussion on: Stop Using React? But Why??

Collapse
 
yoursunny profile image
Junxiao Shi • Edited

Web servers are already serving static assets from memory: the Linux kernel supports filesystem caching, so that any file recently accessed would be in the memory, despite that the web server is accessing them via filesystem API.

Collapse
 
masterroshan profile image
TJ Johnson

Caching can also be configured in nginx and apache, and browsers will also cache.

Collapse
 
thorx86 profile image
Athaariq Ardhiansyah

The main goal is actually prevents disk hit at all cost (for frontend, not backend) in simplest way. Previously I have been fiddling Nginx on my former startup. Sometimes nginx thinks there is a cache miss and add 2-6 seconds of delay with in cached condition as fast as ~600ms. Then I tried to mount ramdisk as Junxiao said. However, it's really hassle to reimplement it on server and ended up messed everything after restart the VPS. So I made a tool (Kuda) to prevent that from happening again and hopefully can be useful for most people.

Thread Thread
 
masterroshan profile image
TJ Johnson

That's awesome and power to you!

It would be interesting to see some benchmarks of different configurations

Thread Thread
 
thorx86 profile image
Athaariq Ardhiansyah

Unfortunately, I don't have enough resource to do benchmark (no, I won't burst +1000 connections to my laptop). It's built on top of FastHTTP though, so it's expected to be faster than FastHTTP in term of serving static file.

Available benchmark reference: dizzy.zone/2018/01/23/Kestrel-vs-G...

If anyone did benchmark on sufficient server, please let us know via issue at github repo. Thank you!