Skip to content

Commit 95c0d3d

Browse files
committed
Add LRU cache to template tag to improve performance
1 parent 0ec95cd commit 95c0d3d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

django_esm/templatetags/esm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import functools
12
import json
23

34
from django import template
@@ -10,6 +11,7 @@
1011

1112

1213
@register.simple_tag
14+
@functools.lru_cache
1315
def importmap():
1416
return mark_safe( # nosec
1517
json.dumps(

0 commit comments

Comments
 (0)