From 378a97601f53f494c63a66f800d6c3f3e4e23e98 Mon Sep 17 00:00:00 2001 From: ziirish Date: Wed, 16 Dec 2015 22:47:39 +0100 Subject: [PATCH] increase cache duration --- burpui/api/client.py | 6 +++--- burpui/api/clients.py | 4 ++-- burpui/api/misc.py | 2 +- burpui/api/servers.py | 2 +- burpui/api/settings.py | 4 ++++ 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/burpui/api/client.py b/burpui/api/client.py index 18af3413..25eec1cc 100644 --- a/burpui/api/client.py +++ b/burpui/api/client.py @@ -45,7 +45,7 @@ class ClientTree(Resource): 'uid': fields.Integer(required=True, description='uid owner of the node'), }) - @api.cache.cached(timeout=600, key_prefix=cache_key) + @api.cache.cached(timeout=3600, key_prefix=cache_key) @api.marshal_list_with(node_fields, code=200, description='Success') @api.doc( params={ @@ -164,7 +164,7 @@ class ClientStats(Resource): 'windows': fields.Boolean(required=True, description='Is the client a windows system'), }) - @api.cache.cached(timeout=120, key_prefix=cache_key) + @api.cache.cached(timeout=1800, key_prefix=cache_key) @api.marshal_with(stats_fields, code=200, description='Success') @api.doc( params={ @@ -380,7 +380,7 @@ class ClientReport(Resource): 'date': fields.String(required=True, description='Human representation of the backup date'), }) - @api.cache.cached(timeout=120, key_prefix=cache_key) + @api.cache.cached(timeout=1800, key_prefix=cache_key) @api.marshal_list_with(client_fields, code=200, description='Success') @api.doc( params={ diff --git a/burpui/api/clients.py b/burpui/api/clients.py index 1d53bb53..4b3d9282 100644 --- a/burpui/api/clients.py +++ b/burpui/api/clients.py @@ -194,7 +194,7 @@ class ClientsReport(Resource): 'clients': fields.Nested(client_fields, as_list=True, required=True), }) - @api.cache.cached(timeout=120, key_prefix=cache_key) + @api.cache.cached(timeout=1800, key_prefix=cache_key) @api.marshal_with(report_fields, code=200, description='Success') @api.doc( params={ @@ -306,7 +306,7 @@ class ClientsStats(Resource): 'percent': fields.Integer(description='Percentage done'), }) - @api.cache.cached(timeout=120, key_prefix=cache_key) + @api.cache.cached(timeout=1800, key_prefix=cache_key) @api.marshal_list_with(client_fields, code=200, description='Success') @api.doc( params={ diff --git a/burpui/api/misc.py b/burpui/api/misc.py index 836c9f31..ec82446f 100644 --- a/burpui/api/misc.py +++ b/burpui/api/misc.py @@ -294,7 +294,7 @@ class About(Resource): 'burp': fields.Nested(burp_fields, as_list=True, description='Burp version'), }) - @api.cache.cached(timeout=300, key_prefix=cache_key) + @api.cache.cached(timeout=3600, key_prefix=cache_key) @api.marshal_with(about_fields, code=200, description='Success') @api.doc( params={ diff --git a/burpui/api/servers.py b/burpui/api/servers.py index 999c8f4b..641a621f 100644 --- a/burpui/api/servers.py +++ b/burpui/api/servers.py @@ -23,7 +23,7 @@ class ServersStats(Resource): 'name': fields.String(required=True, description='Server name'), }) - @api.cache.cached(timeout=120, key_prefix=cache_key) + @api.cache.cached(timeout=1800, key_prefix=cache_key) @api.marshal_list_with(servers_fields, code=200, description='Success') @api.doc( responses={ diff --git a/burpui/api/settings.py b/burpui/api/settings.py index 466dd0da..3a11dca5 100644 --- a/burpui/api/settings.py +++ b/burpui/api/settings.py @@ -264,6 +264,8 @@ class NewClient(Resource): noti.append([3, 'Click here to edit \'{}\' configuration'.format(url_for('view.cli_settings', server=server, client=newclient), newclient)]) else: noti.append([3, 'Click here to edit \'{}\' configuration'.format(url_for('view.cli_settings', client=newclient), newclient)]) + # clear the cache when we add a new client + api.cache.clear() return {'notif': noti}, 201 @@ -305,4 +307,6 @@ class DeleteClient(Resource): api.bui.acl.is_admin(current_user.get_id())): api.abort(403, 'Sorry, you don\'t have rights to access the setting panel') + # clear the cache when we remove a client + api.cache.clear() return {'notif': api.bui.cli.delete_client(client, server)}, 200