Problem with caching graphics files - a code solution?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
skylark2
Forum Commoner
Posts: 32
Joined: Wed Jun 16, 2010 6:00 am

Problem with caching graphics files - a code solution?

Post 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 :)
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

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

Post 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).
Post Reply