4 ms·
What does it mean for a 200 to be faster? I guess I can see some framework or CDN reasons that might be so but it doesn’t feel like an inherent thing
by ketralnis 5y ago
What does it mean for a 200 to be faster? I guess I can see some framework or CDN reasons that might be so but it doesn’t feel like an inherent thing
- CaliforniaKarl 5y agoImagine if you have a site that displays some sort of custom content when a client is hitting a 404 error. Even if it’s just a static page, the web browser still has to follow the code path and open it. Even if it caches the page internally, it still has to regularly check if the file updated on disk. The amount of time spent by the web browser is fairly small, but the parent comment mentioned it in context of an attack, so that small per-page effort multiplied by many connections makes for more of a substantial load.
- Karellen 5y agoBut why can't you just return a 404 with no content instead of a 200 with no content?
- geocrasher 5y agoYou can, but many CMSs (WordPress specifically) do not. They serve a dynamic page.
- deleted 5y ago[deleted]
- jameshart 5y agoIn the case of an attack, you don’t care about how much effort the web browser would have to make, only the web server. In fact, instead of serving a malicious client a 200 empty file, you might want to serve up <script>while(1){}</script> .