Project

General

Profile

Feature #809

Prototype web histogram presenter seems to cache images and not auto refresh

Added by Tunnell, Christopher almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Jackson, Mike
Category:
Online reconstruction
Target version:
Start date:
01 December 2011
Due date:
% Done:

100%

Estimated time:
Workflow:

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?

#1

Updated by Tunnell, Christopher almost 10 years ago

Chris Rogers just found this from google: see the http header 'cache-control'

#2

Updated by Verguilov, Vassil almost 10 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.

#3

Updated by Verguilov, Vassil almost 10 years ago

About the refresh, HTML5 Server-Side Events are good way to refresh when new data is available.

#4

Updated by Jackson, Mike almost 10 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">
    
#5

Updated by Tunnell, Christopher almost 10 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.

#6

Updated by Tunnell, Christopher almost 10 years ago

RIght now everything is in local 127.0.0.1 mode.

#7

Updated by Jackson, Mike almost 10 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.

#8

Updated by Tunnell, Christopher almost 10 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.

#9

Updated by Jackson, Mike almost 10 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)

#10

Updated by Tunnell, Christopher almost 10 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.

#11

Updated by Rogers, Chris almost 10 years ago

  • Target version changed from Future MAUS release to MAUS-v0.1.1

Also available in: Atom PDF