From 202329f64e1c492554685f115ed1b4d6891bae1b Mon Sep 17 00:00:00 2001 From: Ryan Brady Date: Tue, 30 Jun 2015 23:25:38 -0400 Subject: Adds selected memoization Page load times in tuskar-ui are too slow. This patch adds some caching to the tuskarclient and its list function to reduce page load time. Tests locally showed these changes decreased page load time by half in a virt environment. Change-Id: Ib5d67dc2c1a58011739b81156fa50f5cccb223d4 --- tuskar_ui/api/tuskar.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tuskar_ui/api/tuskar.py b/tuskar_ui/api/tuskar.py index 6dd1785e..c97f93e7 100644 --- a/tuskar_ui/api/tuskar.py +++ b/tuskar_ui/api/tuskar.py @@ -39,6 +39,7 @@ KEYSTONE_CERTIFICATE_PARAMS = ( 'KeystoneSigningKey') +@memoized.memoized def tuskarclient(request, password=None): api_version = "2" insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) @@ -152,6 +153,7 @@ class Plan(base.APIResourceWrapper): return cls(plan, request=request) @classmethod + @memoized.memoized def list(cls, request): """Return a list of Plans in Tuskar -- cgit v1.2.1