2

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

3
  • What would be the reason to check for a file update every second? Commented Feb 28, 2020 at 8:14
  • It's on a development environment. I want to see my changes in real time. Commented Feb 28, 2020 at 8: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. Commented Feb 28, 2020 at 8:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.