0

Having already read this question I haven't managed to figure out what the problem is with my web page http://opentox.ntua.gr/vlab/pid/ being cached by Opera. This is how to reproduce the problem:

  1. Navigate to http://opentox.ntua.gr/vlab/pid/ using Opera (version 11.60, build 1185, for Linux)
  2. Don't change any parameters - just click run. Wait a second and you'll get some diagrams.
  3. Now check the checkbox "Open Loop" and click Run again. You should get different results but you don't. The images are cached and they are not reloaded.
  4. Force reload of the first image: Right click on the image and click "Reload Image". You will notice that the reloaded image and has changed...

Now go to Tools > Preferences > Advanced > History. And Set "Memory Cache" to "Off", "Check Documents" to "Always" and "Check Images" to "Always". Click also "Empty now" and exit. Then, the problem is resolved. Is there a way to force Opera to reload the images by specifying a proper header of the HTML document rather that having the users change their configurations globally?

Note that the problem does not reproduce with other browsers and the HTML document already includes in its header the following directives:

<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="CACHE-CONTROL" content=
   "no-store, no-cache, must-revalidate, 
    post-check=0, pre-check=0, max-age=0"/>
<meta http-equiv="Expires" content="0"/>
Community
  • 1
  • 1
Pantelis Sopasakis
  • 1,902
  • 5
  • 26
  • 45

1 Answers1

3

Graphic files have there own headers with caching information witch in your case tells opera it's ok to use cached files - you can check headers using for example firebug for ff. Try adding something like this inside your .htaccess

More about this here http://httpd.apache.org/docs/2.0/mod/mod_expires.html

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/gif "access plus 1 second"
    ExpiresByType image/jpeg "access plus 1 second"
    ExpiresByType image/png "access plus 1 second"
</IfModule> 

It should work but probably there's a cleaner way to write it - I'm not an expert on .htaccess.

You may also serve files through a php script with first spits a proper header with no-cache and then writes out gifs read from hd. Hope this helps.

szym
  • 3,028
  • 2
  • 20
  • 32