I am desperate to get help with a caching issue we are expereincing with a Flex application we are building. Here's the details:
The application is developed on Flex 3.2 SDK.
Its an online album builder application containing 8 different tabs with many show/hide features which works dynamically based on XML response of HTTP Service request. This application shows real time previews of an album based on options selected by user.
The size of the swf script file is around 800+ MB.
We are facing following the problem with this application (mainly in Mac OS).
Many times the script loads the cache memory. Hence the user can not see the latest changes saved during their last visit, even if they are saved.
We have tried following solutions so the saved version shows the latest and greatest version rather than the cached version.
Solution Implemented (Flex Application)
- Set cachePolicy="off" for an Flex application.
- Set historyManagementEnabled="false" for an Flex application.
- Set Framework Linkage = "Runtime shared library (RSL)" under Flex Build Path settings for project properties. To reduce the swf file size.
- load all data/content/images using HTTPService request/response with XML.
Solution Implemented in PHP pages which shows swf file on website.
- Set following headers in PHP page.
// Date in the past
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
- Set query string parameter to load latest swf file and avoid browser caching. (e.g. <param name="movie" value="LeatherCraftmen.swf?t=CURRENT_TIMESTAMP&r=RANDOM_NUMBER" />
Is there any solution to avoid caching of flash/flex in Mac OS?
PLEASE HELP. WE ARE OUT OF SOLUTIONS....
it's the browser cache the swf file
i use the random number, append the swf url, such as "***.swf?random=Math.random()", or you can append the version, when you upgrade the application change the version
Thanks for the reply. I am the project manager and don't know much about the technical end of Flex.
I was told updating from version 3.2 to current version would require a ton of recoding becuase they are vastly different. Is that the case?
You feedback is greatly appreciated.
we develope app have this problem with using module
the browser will cache the swf which is not the recently version, unless i change the ie setting, set option "Check for new versions of stored pages " value to "Every time I visit the webpage". so the browser can load the latest swf file