how to clear static files from fast api?

Viewed 29

I created static files in fast API to use in html file. it is working fine as expected. but the issue is when I try to change static files, it is not updating. even I deleted the files, restarted server and closed and reopened the browser. but still it is in memory. how to change/ remove static files ?

I attached sample code below.

py:

from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles



app = FastAPI()
app.mount("/static", StaticFiles(directory="static"), name="static")

html:

<!DOCTYPE html>
<style>

body {
     background: rgb(235, 213, 224);
     background-image:url("{{ url_for('static', path='/images/chola.png') }}");
     background-repeat: no-repeat;
     background-attachment: fixed;
     background-size: 100% 100%;
     padding-left: 210px;
     word-wrap: break-word;
     line-height: 1.6;
}
</style>
0 Answers
Related