FEATURE: if site is under extreme load show anon view

If a particular path is being hit extremely hard by logged on users,
revert to anonymous cached view.

This will only come into effect if 3 requests queue for longer than 2 seconds
on a *single* path.

This can happen if a URL is shared with the entire forum base and everyone
is logged on
This commit is contained in:
Sam
2018-04-18 16:58:40 +10:00
parent 7bf9650e96
commit 59cd7894d9
6 changed files with 125 additions and 10 deletions
@@ -9,6 +9,11 @@ export default Ember.Component.extend(bufferedRender({
buildBuffer(buffer) {
let notices = [];
if ($.cookie("dosp") === "1") {
$.cookie("dosp", null, { path: '/' });
notices.push([I18n.t("forced_anonymous"), 'forced-anonymous']);
}
if (this.session.get('safe_mode')) {
notices.push([I18n.t("safe_mode.enabled"), 'safe-mode']);
}