Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Make local server reload code after changes

I have files index.html and style.css I want to test using a local server, which I do by running python -m http.server.

If I make a change to file style.css (i.e. a file that is not index.html), then when I reload the page I’d like to see the corresponding update. When this actually happens, on the terminal the following appears:

::ffff:127.0.0.1 - - [11/Aug/2022 09:55:24] "GET /style.css HTTP/1.1" 200 -

but this happens very inconsistently: more often than not, when I make a change to the file and reload the page, it doesn’t update at all.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What can I do so that each time I reload the page, the server reloads style.css?

>Solution :

You can press CTRL + F5 force browser to get data from server immediately not from browser’s cache.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading