Merge "web: Allow clients (browsers, proxies) to cache status.json"
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 21fb04c..c872b23 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -2118,7 +2118,10 @@
self.assertIn('Content-Type', headers)
self.assertEqual(headers['Content-Type'],
'application/json; charset=UTF-8')
+ self.assertIn('Access-Control-Allow-Origin', headers)
+ self.assertIn('Cache-Control', headers)
self.assertIn('Last-Modified', headers)
+ self.assertIn('Expires', headers)
data = f.read()
self.worker.hold_jobs_in_build = False
diff --git a/zuul/webapp.py b/zuul/webapp.py
index e289398..44c333b 100644
--- a/zuul/webapp.py
+++ b/zuul/webapp.py
@@ -121,5 +121,10 @@
raise webob.exc.HTTPNotFound()
response.headers['Access-Control-Allow-Origin'] = '*'
+
+ response.cache_control.public = True
+ response.cache_control.max_age = self.cache_expiry
response.last_modified = self.cache_time
- return response
+ response.expires = self.cache_time + self.cache_expiry
+
+ return response.conditional_response_app