More changes to cached index.php logging

- record lag time in the log
- use an <img> tag rather than an AJAX request to reduce false
  positives caused by slow internet