diff --git a/jupyterhub/handlers/static.py b/jupyterhub/handlers/static.py index e9c54199..f5608e06 100644 --- a/jupyterhub/handlers/static.py +++ b/jupyterhub/handlers/static.py @@ -15,7 +15,9 @@ class CacheControlStaticFilesHandler(StaticFileHandler): return None def set_extra_headers(self, path): - if "v" not in self.request.arguments: + if "v" not in self.request.arguments or self.settings.get( + "no_cache_static", False + ): self.add_header("Cache-Control", "no-cache") diff --git a/testing/jupyterhub_config.py b/testing/jupyterhub_config.py index c82e8511..920156e4 100644 --- a/testing/jupyterhub_config.py +++ b/testing/jupyterhub_config.py @@ -19,3 +19,10 @@ c.JupyterHub.spawner_class = SimpleLocalProcessSpawner # only listen on localhost for testing c.JupyterHub.bind_url = 'http://127.0.0.1:8000' + +c.JupyterHub.tornado_settings = { + "no_cache_static": True, +} + +c.JupyterHub.admin_users = {"admin"} +c.JupyterHub.allow_all = True