Skip to content

Commit 80ad8e3

Browse files
Add no-cache headers to static files. (#526)
1 parent 5f14102 commit 80ad8e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

aiohttp_devtools/runserver/serve.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,8 @@ async def _handle(self, request: web.Request) -> web.StreamResponse:
363363
else:
364364
# Inject CORS headers to allow webfonts to load correctly
365365
response.headers['Access-Control-Allow-Origin'] = '*'
366+
367+
# Add no-cache header to avoid browser caching in local development.
368+
response.headers["Cache-Control"] = "no-cache"
369+
366370
return response

0 commit comments

Comments
 (0)