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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user