Comment 1 for bug 804544

Revision history for this message
Richard Wall (richardw) wrote :

Thanks Jeff,

I converted your question to a new bug.

I think the problem is likely to be that your web browser is caching the downloaded RRD files.

I used to use the "jquery.ajax.cache = false" setting in trunk - this caused jquery to append a random query string to each ajax request.
I recently removed that setting - it didn't seem to be necessary.

So can you send me the http headers (as reported by Firefox Firebug or Wireshark) of an initial RRD download and a subsequent download (after clicking "update" button)
Lets see how it compares to my headers from Firefox and Nginx.

{{{
GET /docs/examples/data/load/load.rrd HTTP/1.1

Host: localhost:8080

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0

Accept: text/plain, */*; q=0.01

Accept-Language: en-gb,en;q=0.5

Accept-Encoding: gzip, deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Connection: keep-alive

X-Requested-With: XMLHttpRequest

Referer: http://localhost:8080/docs/examples/

If-Modified-Since: Fri, 01 Jul 2011 21:45:17 GMT

HTTP/1.1 304 Not Modified

Server: nginx/0.8.54

Date: Fri, 01 Jul 2011 21:45:21 GMT

Last-Modified: Fri, 01 Jul 2011 21:45:17 GMT

Connection: keep-alive

...

GET /docs/examples/data/load/load.rrd HTTP/1.1

Host: localhost:8080

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0

Accept: text/plain, */*; q=0.01

Accept-Language: en-gb,en;q=0.5

Accept-Encoding: gzip, deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Connection: keep-alive

X-Requested-With: XMLHttpRequest

Referer: http://localhost:8080/docs/examples/

If-Modified-Since: Fri, 01 Jul 2011 21:47:27 GMT

HTTP/1.1 200 OK

Server: nginx/0.8.54

Date: Fri, 01 Jul 2011 21:48:13 GMT

Content-Type: application/octet-stream

Last-Modified: Fri, 01 Jul 2011 21:48:07 GMT

Transfer-Encoding: chunked

Connection: keep-alive

Content-Encoding: gzip

}}}

You could also try using the following patch - which turns on the jquery anti-caching mechanism.

{{{
=== modified file 'jarmon/jarmon.js'
--- jarmon/jarmon.js 2011-06-26 22:03:58 +0000
+++ jarmon/jarmon.js 2011-07-01 21:18:12 +0000
@@ -241,6 +241,7 @@
     $.ajax({
         url: url,
         dataType: 'text',
+ cache: false,
         mimeType: 'text/plain; charset=x-user-defined',
         xhr: function() {
             // Save a reference to the native xhr object - we need it later

}}}

Ideally I don't want to use that technique. The correct solution probably involves some or all of the following:

 * Modify the Javascript to read the update interval from the initially downloaded RRD file and only re-request the file after that interval has passed.
 * Configure jquery / xhr to issue ajax requests with the if-modified-since and If-None-Match request headers
 * The web server should be configured to return etags and 304 not modified headers if the file has not changed.

I'll try and work on this in the next few days.

-RichardW