Cache site config per-request to reduce DB queries from template render (#23791)

ARCHBOM-1139: We were seeing about 150 queries to the django_site table
and over 200 to memcached just to load the login page. A lot of these
are via mako template rendering, but there are other sources, and this
will hopefully nip it in the bud.
This commit is contained in:
Tim McCormack
2020-04-23 11:37:45 -04:00
committed by GitHub
parent 70d09e6bf2
commit 7a406d4417

View File

@@ -4,8 +4,10 @@ Helpers methods for site configuration.
from django.conf import settings
from openedx.core.lib.cache_utils import request_cached
@request_cached("site_config")
def get_current_site_configuration():
"""
Return configuration for the current site.