diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py index 45317066..fd3174f8 100644 --- a/src/octoprint/server/util/flask.py +++ b/src/octoprint/server/util/flask.py @@ -76,6 +76,11 @@ def cached(timeout=5 * 60, key=lambda: "view/%s" % flask.request.path, unless=No logger.debug("Cache bypassed, calling wrapped function") return f(*args, **kwargs) + # also bypass the cache if it's disabled completely + if not settings().getBoolean(["devel", "cache", "enabled"]): + logger.debug("Cache disabled, calling wrapped function") + return f(*args, **kwargs) + cache_key = key() # only take the value from the cache if we are not required to refresh it from the wrapped function diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 7ed93369..27dec306 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -237,6 +237,9 @@ default_settings = { }, "devel": { "stylesheet": "css", + "cache": { + "enabled": True + }, "virtualPrinter": { "enabled": False, "okAfterResend": False,