Skip to content
Commits on Source (2)
......@@ -137,6 +137,7 @@ class TrackerService(webservice_base_class):
self.db = security_db.DB(db_name)
self.json_data = None # the JSON dump itself
self.json_timestamp = None # timestamp of JSON generation
self.json_last_modified = None
self.register('', self.page_home)
self.register('*', self.page_object)
self.register('redirect/*', self.page_redirect)
......@@ -1452,14 +1453,15 @@ Debian bug number.'''),
# store the JSON dump in memory, and update the generation
# timestamp before returning
new_data = json.dumps(data, separators=(',', ':'))
self.json_timestamp = time.time()
if new_data != self.json_data:
self.json_data = new_data
self.json_timestamp = time.time()
self.json_last_modified = self.json_timestamp
return self.json_data
def page_json(self, path, params, url):
result = BinaryResult(self._get_json(),'application/json')
result.headers['Last-Modified'] = email.utils.formatdate(self.json_timestamp, usegmt=True)
result.headers['Last-Modified'] = email.utils.formatdate(self.json_last_modified, usegmt=True)
return result
def page_debsecan(self, path, params, url):
......