File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 9
9
@component
10
10
def static_css (static_path : str ):
11
11
"""Fetches a CSS static file for use within IDOM. This allows for deferred CSS loading."""
12
- return html .style (_cached_static_contents (static_path , "css_contents" ))
12
+ return html .style (_cached_static_contents (static_path ))
13
13
14
14
15
15
@component
16
16
def static_js (static_path : str ):
17
17
"""Fetches a JS static file for use within IDOM. This allows for deferred JS loading."""
18
- return html .script (_cached_static_contents (static_path , "js_contents" ))
18
+ return html .script (_cached_static_contents (static_path ))
19
19
20
20
21
- def _cached_static_contents (static_path : str , cache_name : str ):
21
+ def _cached_static_contents (static_path : str ):
22
22
# Try to find the file within Django's static files
23
23
abs_path = find (static_path )
24
24
if not abs_path :
@@ -28,7 +28,7 @@ def _cached_static_contents(static_path: str, cache_name: str):
28
28
29
29
# Fetch the file from cache, if available
30
30
last_modified_time = os .stat (abs_path ).st_mtime
31
- cache_key = f"django_idom:{ cache_name } :{ static_path } "
31
+ cache_key = f"django_idom:static_contents :{ static_path } "
32
32
file_contents = IDOM_CACHE .get (cache_key , version = last_modified_time )
33
33
if file_contents is None :
34
34
with open (abs_path , encoding = "utf-8" ) as static_file :
You can’t perform that action at this time.
0 commit comments