PDA

View Full Version : Cache


gabi_jackass
05-11-2008, 08:55 PM
Hello

I plan to build a simple GUI to insert / edit tours in the portal that I’m working on. I’ve just implemented a feature for changing the tour image.

The problem is that after I replace then image I need to close and reopen the browser to see the new image loaded. If I just hit the refresh button, even Ctrl + F5 it still displaying the old image. Is obvious that is loading it from cache but it shouldn’t because the new image has a different name specially to prevent this.

The funny part is that even if I rename / delete the image from disk and refresh the browser it’s sill displaying the image. It’s cool to have the image loaded from cache but …. Not always. Is there any control on this?

Any idea about the problem?

koma
05-12-2008, 10:18 AM
Probably this isn't what you're looking for but is still very nice to have: Firebug-Plugin (http://chrispederick.com/work/web-developer/) for Firefox. You can disable cache here.

gabi_jackass
05-15-2008, 09:36 AM
Thanks but I need it to work in IE also.

The only work around to fix this is to have a link that is opening the pano in a new browser window. This way the changes seems to reflect in the new loaded browser window.

But if a change anything (like the image) a simple refresh for the browser doesn’t do the job. I need to close and reopen the browser.

I’ve also tried with a iFrame and a URL unique refresh number added at the end to force the page to be reloaded.

Also I’ve added the <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> tag to also forced the page no not use the cache (see http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14743 ).

No success with any of the items except for opening the browser page again. Is this the way Flash works? It’s keeping the cache liked with the browser session and nothing can be done?

GregorH
05-15-2008, 10:11 AM
The cache problem -if I understand you right!- has nothing to do with your images getting cached. Ithe XML file gets cached and thats why <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> and renaming the images does not work.

Try to rename the xml files instead.

gabi_jackass
05-16-2008, 10:52 PM
The cache problem -if I understand you right!- has nothing to do with your images getting cached. Ithe XML file gets cached and thats why <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> and renaming the images does not work.

Try to rename the xml files instead.



I use an ASPX page to generate the XML and I add a unique parameter to make sure the URL is unique.

Sample: so.addVariable("xml_file",'Pages/Internal/FlashPanoramasXml.aspx?TourId=136&r=d22d4ade-ecb3-4637-9947-52e7909427b0');

gabi_jackass
05-18-2008, 06:21 AM
I found the issue. From a unknown reason you can specify only one parameter to the xml file.

Basically if you have

so.addVariable("xml_file",'Pages/Internal/FlashPanoramasXml.aspx?TourId=136&r=d22d4ade-ecb3-4637-9947-52e7909427b0');

then only the “Pages/Internal/FlashPanoramasXml.aspx?TourId=136” URL will be used by the player. Because of this the URL was not unique and it was considered to be the same even if it wasn’t.

The workaround for this is to use only one parameter and to include in value all the needed data separated by a character.

For example: 'Pages/Internal/FlashPanoramasXml.aspx?Data=136|r=d22d4ade-ecb3-4637-9947-52e7909427b0’.This URL has only one parameter (“Data”) and the value of it (“136|r=d22d4ade-ecb3-4637-9947-52e7909427b0”) is containing all needed items (“136” – tour id and “d22d4ade-ecb3-4637-9947-52e7909427b0” – the unique string).

This does the job.
Any idea if this is the way flash works or is a bug of the FPP?

cheathamlane
05-18-2008, 10:37 PM
Yikes!, what a workaround...

What happens if you URL or HTML encode that ampersand ("&")?

If it IS the case that only the first variable is getting passed, please send an email off to Denis -- That doesn't seem like expected behavior to me.