Disable cache in google chrome (Mac) for development in flex / flash

What is the best way to disable cache in google chrome for mac, so when I develop a flash application it will appear in a new movie every time?

Please advise that I cannot figure out how to provide the .swf version that I am looking at is the latest version.

One solution might be to force the flex compiler to add a timestamp to the .swf file names, is this possible?

Thanks!

+4
source share
3 answers

Go to the "View" menu, open the "Developer Tools". In the lower right corner of the Developer Tools is a gear icon. Click on it, then select the "Disable cache" checkbox.

+4
source

In your embed code, where ever you are a SWF file, you must put a random number or timestamp of some type in the request. Whenever there is a query string that changes, the browser does not cache the page.

"MySWFName.swf?t=" + new Date().getTime(); 

A better way would be to embed SWF using SWFObject with this code.

In the html body tag do this.

 <body onLoad="loaded()" onunload"doUnload( )"> <div id="replaceMe">Loading content.</div> </body> 

and for javascript to do this (obviously, changing the material enclosed in {} to your needs

 <script type="text/javascript" src="swfobject.js"> <script type="text/javascript"> function loaded() { var flashvars={}, params={}, attributes={}, tmp, version, width, height, container, flashObj; flashvars.userName = "testvar"; params.menu = "true"; params.quality = "high"; params.bgcolor = "${bgcolor}"; params.allowscriptaccess = "always"; params.allownetworking = "all"; attributes.id = "${application}"; attributes.name = "${application}"; attributes.align = "middle"; attributes.allowscriptaccess = "always"; attributes.allownetworking = "all"; tmp = "expressInstall.swf"; version = "${version_major}.${version_minor}.${version_revision}"; width = "${width}"; height = "${height}"; container = "replaceMe"; flashObj = "${swf}.swf?t=" + new Date().getTime(); swfobject.embedSWF(flashObj, container, width, height, version, tmp, flashvars, params, attributes); } </script> 


Remember to add a copy of SWFobject
You will never have caching problems.

EDIT: BTW, if you replace your code in the html.template.html file with this code, it will generate values ​​for you. :)

+4
source

Personally, I would never do that. Caching exists for some reason and should not be disabled if you use it locally. In my experience, the best way to do this is to have it every time you create it every time you create (usually statically correctly in the class) using Ant or Maven, even better if you have an automation mechanism for that too), which then bound this version number as the url parameter for the flash movie, for example Movie.swf?version=1.31 in html.

0
source

Source: https://habr.com/ru/post/1346116/


All Articles