mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 14:19:49 +08:00
32393f72b1
When the server gets overloaded and lots of requests start queuing server will attempt to shed load by returning 429 errors on background requests. The client can flag a request as background by setting the header: `Discourse-Background` to `true` Out-of-the-box we shed load when the queue time goes above 0.5 seconds. The only request we shed at the moment is the request to load up a new post when someone posts to a topic. We can extend this as we go with a more general pattern on the client. Previous to this change, rate limiting would "break" the post stream which would make suggested topics vanish and users would have to scroll the page to see more posts in the topic. Server needs this protection for cases where tons of clients are navigated to a topic and a new post is made. This can lead to a self inflicted denial of service if enough clients are viewing the topic. Due to the internal security design of Discourse it is hard for a large number of clients to share a channel where we would pass the full post body via the message bus. It also renames (and deprecates) triggerNewPostInStream to triggerNewPostsInStream This allows us to load a batch of new posts cleanly, so the controller can keep track of a backlog Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com> |
||
---|---|---|
.. | ||
admin | ||
confirm-new-email | ||
discourse | ||
discourse-common | ||
docs | ||
ember-addons | ||
locales | ||
pretty-text | ||
select-kit | ||
wizard | ||
activate-account.js | ||
admin.js.erb | ||
app-boot.js | ||
application.js | ||
auto-redirect.js | ||
browser-detect.js | ||
discourse-loader.js | ||
discourse-shims.js | ||
embed-application.js | ||
ember_include.js.erb | ||
ember_jquery.js | ||
env.js | ||
google-tag-manager.js | ||
google-universal-analytics.js | ||
handlebars-shim.js | ||
main_include_admin.js | ||
markdown-it-bundle.js | ||
onpopstate-handler.js | ||
polyfills.js | ||
pretty-text-bundle.js | ||
print-page.js | ||
service-worker.js.erb | ||
set-prototype-polyfill.js | ||
start-discourse.js | ||
template_include.js | ||
test-shims.js | ||
vendor.js | ||
widget-runtime.js | ||
wizard-application.js | ||
wizard-shims.js | ||
wizard-start.js | ||
wizard-vendor.js |