Feature #809
Prototype web histogram presenter seems to cache images and not auto refresh
100%
Description
At least using Firefox 3.6.24 on Scientific Linux. I think there's some HTML tag that tells the browser to not cache images that should be used. Vassil knows what this is (and suggested it) so can elaborate. Also, can it auto refresh every 5 seconds, at least for the moment until it is customizable?
Updated by Tunnell, Christopher almost 12 years ago
Chris Rogers just found this from google: see the http header 'cache-control'
Updated by Verguilov, Vassil almost 12 years ago
The server response should set the Cache-control HTTP header to "no-store"
Here it is explained how to do it with django:
https://docs.djangoproject.com/en/dev/topics/cache/#controlling-cache-using-other-headers
I suggest you use the never_cache decorator.
Updated by Verguilov, Vassil almost 12 years ago
About the refresh, HTML5 Server-Side Events are good way to refresh when new data is available.
Updated by Jackson, Mike almost 12 years ago
The caching isn't the browser or Django. Just now, it's the implementation. It reads a directory of EPS, creates PNG thumbnails and stores these. If the page is reloaded it only creates new thumbnails for which there haven't been any already created. This was to avoid a refresh of a page with many images grinding to a halt as it attempted to regenerate all the thumbnails.
I've checked in a new version (11) that:
- Regenerates the thumbnails every time the index page is reloaded.
- Adds the following to the HTML to give a browser refresh every 5s (tested on IE, Firefox and Safari):
<meta http-equiv="REFRESH" content="5">
Updated by Tunnell, Christopher almost 12 years ago
Wonderful, we'll test it out right now. Quick question: how many thumbnails per second can be reasonably generated? The implementation mentioned above works for the moment... just don't want an accidental DOS attack.
Updated by Tunnell, Christopher almost 12 years ago
RIght now everything is in local 127.0.0.1 mode.
Updated by Jackson, Mike almost 12 years ago
Sorry, I'm not sure what "reasonable" might be. I implemented it the way I did originally in case it might be 100s.
Updated by Tunnell, Christopher almost 12 years ago
Is it computationally expensive? Should we cache it rather? Well, in the long term I guess the answer is 'yes' since, as you said correctly, 100 or so plots.
Updated by Jackson, Mike almost 12 years ago
Again, don't know. I ass-umed it would be (EPS->PNG) but I was focusing more on getting "something" working than any performance assessments (since we'd be returning to this component later)
Updated by Tunnell, Christopher almost 12 years ago
- Tracker changed from Bug to Feature
- Subject changed from web histogram presenter seems to cache images and not auto refresh to Prototype web histogram presenter seems to cache images and not auto refresh
- Status changed from Open to Closed
- % Done changed from 0 to 100
Which is perfectly reasonable. Just small requirements for testing things out today.
Updated by Rogers, Chris almost 12 years ago
- Target version changed from Future MAUS release to MAUS-v0.1.1