# Plotly dash doen not update a image

**URL:** <https://community.plotly.com/t/plotly-dash-doen-not-update-a-image/47211>\
**Category:** Dash Python\
**Created:** [November 16, 2020, 6:31pm UTC](https://community.plotly.com/t/plotly-dash-doen-not-update-a-image/47211 "2020-11-16T18:31:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvilca](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jvilca](https://community.plotly.com/u/jvilca)\
**Post date:** [November 16, 2020, 6:31pm UTC](https://community.plotly.com/t/plotly-dash-doen-not-update-a-image/47211/1 "2020-11-16T18:31:27Z")

</div>

Hi everybody. I have to update an image in a web page. I am using dcc.Interval to set the time interval and update the image from the url. The frequency is 30 seconds, however the image keeps the same. Why the image is not update? Thanks in advance. I share the code.

app = dash.Dash(external\_stylesheets=[dbc.themes.BOOTSTRAP])

app.layout = html.Div([  
dcc.Interval(  
id=‘sab-images-interval-component’,  
interval=30\*1000, # 30 seconds  
n\_intervals=0  
),

```
dbc.Col([
    dbc.Row([
        dbc.Col(html.Div(id='disp_sab_div'), width=2),
    ], no_gutters=True, align="center"),
]),

```

])

@app.callback(  
[  
Output(component\_id=‘disp\_sab\_div’, component\_property=‘children’)  
],  
[  
Input(component\_id=‘sab-images-interval-component’, component\_property=‘n\_intervals’)  
]  
)  
def \_updateDispSab(n):  
\_div =   
image\_filename = ‘[http://179.xx.yy.zz/SBYA/Sab\_cam.jpg](http://179.xx.yy.zz/SBYA/Sab_cam.jpg)’  
title =‘Sabancay from Chivay’

```
print(str(dt.datetime.now()))

_div = html.Div([
    html.Img(
        src=image_filename,
        style={
            'width': '100%',
        }
    ),
])

return [_div]

```

if **name** == ‘ **main** ’:

---

<div class="post-metadata">

**Author:** ![jvilca](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jvilca](https://community.plotly.com/u/jvilca)\
**Post date:** [November 16, 2020, 9:54pm UTC](https://community.plotly.com/t/plotly-dash-doen-not-update-a-image/47211/2 "2020-11-16T21:54:34Z")

</div>

The image is saved in the cache of navigator so I have to decieve the navigaton in order to reload the image. One method is to add timestamp at the end of url. Eg.

import time  
\_ulr = '[http://179.xx.yy.zzSBYA/Sab\_cam.jpg?’+str(time.time()](http://179.xx.yy.zzSBYA/Sab_cam.jpg?'+str(time.time()))

I spend 4 hours to find this solution.
