diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-28 15:12:53 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-28 15:13:03 +0000 |
commit | e2c71a4bd41470b9503021db36be2ae65f345d97 (patch) | |
tree | f368fae32ea56ea10fb6642254b7fce9d7acaccc | |
parent | cd7e8fb42b447efa77319aa8931cf5f5e65c418e (diff) | |
download | stable-diffusion-webui-gfx803-e2c71a4bd41470b9503021db36be2ae65f345d97.tar.gz stable-diffusion-webui-gfx803-e2c71a4bd41470b9503021db36be2ae65f345d97.tar.bz2 stable-diffusion-webui-gfx803-e2c71a4bd41470b9503021db36be2ae65f345d97.zip |
make prevent the browser from using cached version of scripts when they change
-rw-r--r-- | modules/ui.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/ui.py b/modules/ui.py index 9f4cfda1..4e082408 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1692,14 +1692,14 @@ def create_ui(): def reload_javascript():
- head = f'<script type="text/javascript" src="file={os.path.abspath("script.js")}"></script>\n'
+ head = f'<script type="text/javascript" src="file={os.path.abspath("script.js")}?{os.path.getmtime("script.js")}"></script>\n'
inline = f"{localization.localization_js(shared.opts.localization)};"
if cmd_opts.theme is not None:
inline += f"set_theme('{cmd_opts.theme}');"
for script in modules.scripts.list_scripts("javascript", ".js"):
- head += f'<script type="text/javascript" src="file={script.path}"></script>\n'
+ head += f'<script type="text/javascript" src="file={script.path}?{os.path.getmtime(script.path)}"></script>\n'
head += f'<script type="text/javascript">{inline}</script>\n'
|