3 ms·
Personally if it were my site I would put in some time to cache a few things. Rails makes this fairly easy with https://guides.rubyonrails.org/caching_with_rail
by nickjj 5y ago
Personally if it were my site I would put in some time to cache a few things. Rails makes this fairly easy with https://guides.rubyonrails.org/caching_with_rails.html https://guides.rubyonrails.org/caching_with_rails.html. I say "fairly" because caching is never really easy because of what could go wrong but I would say this is as realistically easy as it can get with Rails.
A cold page load on any old StackOverflow answer page is about 50ms for me. Keep in mind the hosting environments between both sites too. The forum site is on Heroku. StackOverflow is running on https://stackexchange.com/performance https://stackexchange.com/performance, basically hundreds of CPU cores and multiple terrabytes of RAM on dedicated hardware. There's no doubt .NET is going to crush Ruby even with the same hardware tho.
> StackOverflow manages sub 20ms response on nearly all pages time with zero caching
I'm not sure where you read they don't cache anything? They cache a lot of things. They have an in depth article on this at https://nickcraver.com/blog/2019/08/06/stack-overflow-how-we-do-app-caching https://nickcraver.com/blog/2019/08/06/stack-overflow-how-we.... They're also serving a lot from a CDN to give end to end low latency responses across the globe.
- ksec 5y agoThe 20ms is straight form the Stackexchange Performance page in your link, at the bottom of the page. That is server response time. I assume your 50ms is with latency, and paint delay included? They only cache static asset like images, they dont cache page in CDN. [1] There is probably a better tweet which I cant find right now, but they dont cache page on their server either, every thing is generated on demand. [2] StackOverflow is quite famous for not doing any cache and dont use CDN. HN doesn't use CDN either and uses minimal cache ( for non-logged in users ). But yes the hardware is quite far apart. My opinion is that I dont think we should settle for 500ms response time as acceptable. But then it is quite costly on Heroku...... [1] https://twitter.com/Nick_Craver/status/1318296453266231297 https://twitter.com/Nick_Craver/status/1318296453266231297 [2] https://twitter.com/Nick_Craver/status/1410549840493350915 https://twitter.com/Nick_Craver/status/1410549840493350915
- nickjj 5y ago50ms includes just latency (not paint). Yeah I don't know, their blog says they have almost 100GB of cached data and it's slow without it (their direct words from the post). I'm not sure why they would write about something but tweet something else, it's the same person too. > My opinion is that I dont think we should settle for 500ms response time as acceptable Sure, it's a perceivable amount of delay. Fortunately with Rails you can achieve <= 150ms response times without too much trouble which I think is fast enough where no one is going to notice a difference between a 125ms and 25ms back-end response when the total end to end time painted in their browser might be 750ms (back-end response + latency + paint). The total end to end time is what the user experiences.
- ksec 5y ago>have almost 100GB of cached data and it's slow without it They dont cache the the generated pages, but they do cache the common backend Data and some keys required for DB. They are used more like an In-Memory DB rather than Cache. Some of those cache are not longer required once they moved to .Net Core 6.0. But Nick went to work for Microsoft once StackOverflow were sold to some PE. So we may never get any updated figures.