We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25ebf9c commit c696b3aCopy full SHA for c696b3a
django_unicorn/components.py
@@ -15,6 +15,7 @@
15
from bs4 import BeautifulSoup
16
from bs4.element import Tag
17
from bs4.formatter import HTMLFormatter
18
+from cachetools.lru import LRUCache
19
20
from . import serializer
21
from .decorators import timed
@@ -26,7 +27,7 @@
26
27
28
29
# Module cache to reduce initialization costs
-constructed_views_cache = {}
30
+constructed_views_cache = LRUCache(maxsize=100)
31
32
33
class UnicornField:
pyproject.toml
@@ -16,6 +16,7 @@ beautifulsoup4 = "^4.9.1"
orjson = "^3.2.1"
shortuuid = "^1.0.1"
wrapt = "^1.12.1"
+cachetools = "^4.1.1"
[tool.poetry.dev-dependencies]
22
pytest = "^5.4.3"
0 commit comments