Page 1 of 1

Problem with caching graphics files - a code solution?

Posted: Fri Mar 25, 2011 8:46 am
by skylark2
I discovered while testing that my application has an issue with Opera out-of-the-box in that the default cache length for graphics is 5 hours. But I redraw my SVG files (and reuse the filename) every time the user does something.

I know how to fix this by reconfiguring Opera, but can anyone tell me in words of one syllable if there's something I can put in the svg file header to stop it happening? I tried cachecontrol="nocache" which I thought should work but it didn't help.

Hoping I can do it at this level - telling all users to reconfigure their browsers won't be much of a solution, and I'd rather not require complicated Apache configuration since I'm doing this for a third party - the more configuration which is under my control, i.e. being written to the browser by my code, the better :)

Re: Problem with caching graphics files - a code solution?

Posted: Thu Mar 31, 2011 8:06 pm
by Weirdan
But I redraw my SVG files (and reuse the filename) every time the user does something.
Simple answer - change the URI. Since there's no requirement of 1 to 1 mapping between URIs and filenames you'd just have ignore part of the uri (by putting variable part into the query string, abusing PathInfo or employing mod_rewrite).