@@ -216,7 +216,7 @@ def add_url(name, view_func, methods=('GET',)):
216
216
'{}<path:path>' .format (self .config ['routes_pathname_prefix' ]),
217
217
self .index )
218
218
219
- add_url ('{}_favicon' .format (self .config ['routes_pathname_prefix' ]),
219
+ add_url ('{}_favicon.ico ' .format (self .config ['routes_pathname_prefix' ]),
220
220
self ._serve_default_favicon )
221
221
222
222
self .server .before_first_request (self ._setup_server )
@@ -464,9 +464,22 @@ def index(self, *args, **kwargs): # pylint: disable=unused-argument
464
464
config = self ._generate_config_html ()
465
465
metas = self ._generate_meta_html ()
466
466
title = getattr (self , 'title' , 'Dash' )
467
- favicon = '<link rel="icon" type="image/x-icon" href="{}">' .format (
468
- self .get_asset_url (self ._favicon ) if self ._favicon
469
- else '{}_favicon' .format (self .config .requests_pathname_prefix ))
467
+
468
+ if self ._favicon :
469
+ favicon_mod_time = os .path .getmtime (
470
+ os .path .join (self ._assets_folder , self ._favicon ))
471
+ favicon_url = self .get_asset_url (self ._favicon ) + '?m={}' .format (
472
+ favicon_mod_time
473
+ )
474
+ else :
475
+ favicon_url = '{}_favicon.ico' .format (
476
+ self .config .requests_pathname_prefix )
477
+
478
+ favicon = _format_tag ('link' , {
479
+ 'rel' : 'icon' ,
480
+ 'type' : 'image/x-icon' ,
481
+ 'href' : favicon_url
482
+ }, opened = True )
470
483
471
484
index = self .interpolate_index (
472
485
metas = metas , title = title , css = css , config = config ,
0 commit comments