1

The idea

To speed up my development I want to automatically refresh the browser if I change the file test.html.

My setup

I'm on Linux and I start my server with

python -m SimpleHTTPServer

in a terminal so that I can open my test.html in my browser with

http://localhost:8000/test.html

I have to open the test.html like this (and not with file://) because I use live.js. This javascript tool checks every second (!) if test.html has changed..and if so it refreshes the browser automatically.

My problem

The checking interval keeps increasing...

enter image description here

...and increasing....

enter image description here

...and never seems to stop

enter image description here

At the end if I change the test.html file is takes a lot of time to refresh the browser.

My question

I want to work live.js in real time but I think the server slows the process down. Am I right?

How can I get live.js to work in real time?

EDIT

As Serge Ballesta suggested I increased the interval to 10 sec but this doesn't work neither.

enter image description here

Sr. Schneider
  • 407
  • 5
  • 14
  • What would be the reason to check for a file update every second? – Kris Feb 28 '20 at 08:14
  • It's on a development environment. I want to see my changes in real time. – Sr. Schneider Feb 28 '20 at 08:15
  • 1
    To make sure, I would either install an Apache httpd server and test the unchanged Live.js against it, or try to tweak Live.js to use an interval of 10s. If either works at a constant rate, then it would be an evidence that `SimpleHTTPServer` is not meant to absord a charge of 1 request per second. – Serge Ballesta Feb 28 '20 at 08:37

0 Answers0