cityindex-attic / logsearch

[unmaintained] A development environment for ELK
Apache License 2.0
24 stars 8 forks source link

IE10 is caching kibana dashboards #210

Closed dpb587 closed 11 years ago

dpb587 commented 11 years ago

For some reason, IE10 is caching kibana dashboards which makes dashboard saves appear ineffective.

dpb587 commented 11 years ago

I've confirmed that IE10 seems to be caching the ajax response despite the specific lack of caching headers. This is unfortunately common in IE, but now I need to figure out what changed upstream in Kibana.


Initial load of the dashboard...

> GET http://logsearch.example.com/kibana-int/dashboard/_grokparsefailure HTTP/1.1
> Referer: http://logsearch.example.com/#/dashboard/elasticsearch/_grokparsefailure
> Accept: application/json, text/plain, */*
> Accept-Language: en-US
> UA-CPU: AMD64
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)
> Host: logsearch.example.com
> DNT: 1
> Proxy-Connection: Keep-Alive
> Cookie: _ga=...snip...
=
< HTTP/1.1 200 OK
< server: nginx/1.1.19
< date: Thu, 24 Oct 2013 15:15:15 GMT
< content-type: application/json; charset=UTF-8
< transfer-encoding: chunked
< connection: close
< access-control-allow-origin: *

Changes made to the dashboard, and saved...

> PUT http://logsearch.example.com/kibana-int/dashboard/_grokparsefailure HTTP/1.1
> Content-Type: application/json;charset=utf-8
> Accept: application/json, text/plain, */*
> Referer: http://logsearch.example.com/#/dashboard/elasticsearch/_grokparsefailure
> Accept-Language: en-US
> UA-CPU: AMD64
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)
> Host: logsearch.example.com
> Content-Length: 3807
> DNT: 1
> Proxy-Connection: Keep-Alive
> Pragma: no-cache
> Cookie: _ga=...snip...
=
< HTTP/1.1 200 OK
< server: nginx/1.1.19
< date: Thu, 24 Oct 2013 15:21:36 GMT
< content-type: application/json; charset=UTF-8
< content-length: 92
< connection: close
< access-control-allow-origin: *

I hit refresh, and the subsequent load of the dashboard...

> GET /kibana-int/dashboard/_grokparsefailure HTTP/1.1
> Referer: http://logsearch.example.com/#/dashboard/elasticsearch/_grokparsefailure
> Accept: application/json, text/plain, */*
> Accept-Language: en-US
> UA-CPU: AMD64
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)
> Host: logsearch.example.com
=
< HTTP/1.1 304 Not Modified
< content-type: application/json; charset=UTF-8
< transfer-encoding: chunked
< access-control-allow-origin: *

The only requests appearing in the server log are for the first two...

192.0.2.191 - - [24/Oct/2013:15:15:16 +0000] "GET /kibana-int/dashboard/_grokparsefailure HTTP/1.1" 200 1428 "http://logsearch.example.com/#/dashboard/elasticsearch/_grokparsefailure" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)" 0.180
192.0.2.191 - - [24/Oct/2013:15:21:36 +0000] "PUT /kibana-int/dashboard/_grokparsefailure HTTP/1.1" 200 92 "http://logsearch.example.com/#/dashboard/elasticsearch/_grokparsefailure" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)" 0.331
dpb587 commented 11 years ago

elasticsearch/kibana/aa4b3ef0:js/services.js#757 switched from using a POST /kibana-int/dashboard/_search to a GET /kibana-int/dashboard/{name}. Unfortunately, IE tends to cache GET requests and now that it's no longer POSTing, we're hitting that IE feature(?).

Preparing an upstream PR, but in the meantime, a different browser is a temporary solution.

mrdavidlaing commented 11 years ago

Thank you IE :angry: !

And it looks like the cleanest "fix" - specifying no cache headers for ajax requests won't work, because Kibana isn't setting a X-Requested-With: header for ajax calls.

AARGH!

dpb587 commented 11 years ago

I think this is fixed - would somebody with a local IE10 instance be able to test it? It's not fully working for me on my VM connection, but I'm not sure if that's due to proxying and latency or an actual bug.

Test Steps:

  1. Open up logsearch from the browser in IE10.
  2. Open up a previously saved dashboard (e.g. _grokparsefailure).
  3. Adjust the query and update the results (e.g. add, adjust, or remove AND @type:ci_appmetrics from the base @tags:"_grokparsefailure").
  4. Re-save the dashboard using the same name.
  5. Refresh the page.
  6. Verify your updated query is shown.
mrdavidlaing commented 11 years ago

@dpb587 I can confirm that this appears to be fixed in IE10

dpb587 commented 11 years ago

@todo push upstream, don't bother patching locally in the meantime

dpb587 commented 11 years ago

Submitted patch.